dmx.xml 138 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418
  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2. <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
  4. <!ENTITY % defs SYSTEM "/xserver/doc/xml/xserver.ent"> %defs;
  5. ]>
  6. <article>
  7. <articleinfo>
  8. <!-- Title information -->
  9. <title>Distributed Multihead X design</title>
  10. <authorgroup>
  11. <author><firstname>Kevin E.</firstname><surname>Martin</surname></author>
  12. <author><firstname>David H.</firstname><surname>Dawes</surname></author>
  13. <author><firstname>Rickard E.</firstname><surname>Faith</surname></author>
  14. </authorgroup>
  15. <pubdate>29 June 2004 (created 25 July 2001)</pubdate>
  16. <releaseinfo>X Server Version &xserver.version;</releaseinfo>
  17. <abstract><para>
  18. This document covers the motivation, background, design, and
  19. implementation of the distributed multihead X (DMX) system. It
  20. is a living document and describes the current design and
  21. implementation details of the DMX system. As the project
  22. progresses, this document will be continually updated to reflect
  23. the changes in the code and/or design. <emphasis remap="it">Copyright 2001 by VA
  24. Linux Systems, Inc., Fremont, California. Copyright 2001-2004
  25. by Red Hat, Inc., Raleigh, North Carolina</emphasis>
  26. </para></abstract>
  27. </articleinfo>
  28. <!-- Begin the document -->
  29. <sect1>
  30. <title>Introduction</title>
  31. <sect2>
  32. <title>The Distributed Multihead X Server</title>
  33. <para>Current Open Source multihead solutions are limited to a single
  34. physical machine. A single X server controls multiple display devices,
  35. which can be arranged as independent heads or unified into a single
  36. desktop (with Xinerama). These solutions are limited to the number of
  37. physical devices that can co-exist in a single machine (e.g., due to the
  38. number of AGP/PCI slots available for graphics cards). Thus, large
  39. tiled displays are not currently possible. The work described in this
  40. paper will eliminate the requirement that the display devices reside in
  41. the same physical machine. This will be accomplished by developing a
  42. front-end proxy X server that will control multiple back-end X servers
  43. that make up the large display.
  44. </para>
  45. <para>The overall structure of the distributed multihead X (DMX) project is
  46. as follows: A single front-end X server will act as a proxy to a set of
  47. back-end X servers, which handle all of the visible rendering. X
  48. clients will connect to the front-end server just as they normally would
  49. to a regular X server. The front-end server will present an abstracted
  50. view to the client of a single large display. This will ensure that all
  51. standard X clients will continue to operate without modification
  52. (limited, as always, by the visuals and extensions provided by the X
  53. server). Clients that are DMX-aware will be able to use an extension to
  54. obtain information about the back-end servers (e.g., for placement of
  55. pop-up windows, window alignments by the window manager, etc.).
  56. </para>
  57. <para>The architecture of the DMX server is divided into two main sections:
  58. input (e.g., mouse and keyboard events) and output (e.g., rendering and
  59. windowing requests). Each of these are describe briefly below, and the
  60. rest of this design document will describe them in greater detail.
  61. </para>
  62. <para>The DMX server can receive input from three general types of input
  63. devices: "local" devices that are physically attached to the machine on
  64. which DMX is running, "backend" devices that are physically attached to
  65. one or more of the back-end X servers (and that generate events via the
  66. X protocol stream from the backend), and "console" devices that can be
  67. abstracted from any non-back-end X server. Backend and console devices
  68. are treated differently because the pointer device on the back-end X
  69. server also controls the location of the hardware X cursor. Full
  70. support for XInput extension devices is provided.
  71. </para>
  72. <para>Rendering requests will be accepted by the front-end server; however,
  73. rendering to visible windows will be broken down as needed and sent to
  74. the appropriate back-end server(s) via X11 library calls for actual
  75. rendering. The basic framework will follow a Xnest-style approach. GC
  76. state will be managed in the front-end server and sent to the
  77. appropriate back-end server(s) as required. Pixmap rendering will (at
  78. least initially) be handled by the front-end X server. Windowing
  79. requests (e.g., ordering, mapping, moving, etc.) will handled in the
  80. front-end server. If the request requires a visible change, the
  81. windowing operation will be translated into requests for the appropriate
  82. back-end server(s). Window state will be mirrored in the back-end
  83. server(s) as needed.
  84. </para>
  85. </sect2>
  86. <sect2>
  87. <title>Layout of Paper</title>
  88. <para>The next section describes the general development plan that was
  89. actually used for implementation. The final section discusses
  90. outstanding issues at the conclusion of development. The first appendix
  91. provides low-level technical detail that may be of interest to those
  92. intimately familiar with the X server architecture. The final appendix
  93. describes the four phases of development that were performed during the
  94. first two years of development.
  95. </para>
  96. <para>The final year of work was divided into 9 tasks that are not
  97. described in specific sections of this document. The major tasks during
  98. that time were the enhancement of the reconfiguration ability added in
  99. Phase IV, addition of support for a dynamic number of back-end displays
  100. (instead of a hard-coded limit), and the support for back-end display
  101. and input removal and addition. This work is mentioned in this paper,
  102. but is not covered in detail.
  103. </para>
  104. </sect2>
  105. </sect1>
  106. <!-- ============================================================ -->
  107. <sect1>
  108. <title>Development plan</title>
  109. <para>This section describes the development plan from approximately June
  110. 2001 through July 2003.
  111. </para>
  112. <sect2>
  113. <title>Bootstrap code</title>
  114. <para>To allow for rapid development of the DMX server by multiple
  115. developers during the first development stage, the problem will be
  116. broken down into three tasks: the overall DMX framework, back-end
  117. rendering services and input device handling services. However, before
  118. the work begins on these tasks, a simple framework that each developer
  119. could use was implemented to bootstrap the development effort. This
  120. framework renders to a single back-end server and provides dummy input
  121. devices (i.e., the keyboard and mouse). The simple back-end rendering
  122. service was implemented using the shadow framebuffer support currently
  123. available in the XFree86 environment.
  124. </para>
  125. <para>Using this bootstrapping framework, each developer has been able to
  126. work on each of the tasks listed above independently as follows: the
  127. framework will be extended to handle arbitrary back-end server
  128. configurations; the back-end rendering services will be transitioned to
  129. the more efficient Xnest-style implementation; and, an input device
  130. framework to handle various input devices via the input extension will
  131. be developed.
  132. </para>
  133. <para>Status: The boot strap code is complete. <!-- August 2001 -->
  134. </para>
  135. </sect2>
  136. <sect2>
  137. <title>Input device handling</title>
  138. <para>An X server (including the front-end X server) requires two core
  139. input devices -- a keyboard and a pointer (mouse). These core devices
  140. are handled and required by the core X11 protocol. Additional types of
  141. input devices may be attached and utilized via the XInput extension.
  142. These are usually referred to as ``XInput extension devices'',
  143. </para>
  144. <para>There are some options as to how the front-end X server gets its core
  145. input devices:
  146. <orderedlist>
  147. <listitem>
  148. <para>Local Input. The physical input devices (e.g., keyboard and
  149. mouse) can be attached directly to the front-end X server. In this
  150. case, the keyboard and mouse on the machine running the front-end X
  151. server will be used. The front-end will have drivers to read the
  152. raw input from those devices and convert it into the required X
  153. input events (e.g., key press/release, pointer button press/release,
  154. pointer motion). The front-end keyboard driver will keep track of
  155. keyboard properties such as key and modifier mappings, autorepeat
  156. state, keyboard sound and led state. Similarly the front-end
  157. pointer driver will keep track if pointer properties such as the
  158. button mapping and movement acceleration parameters. With this
  159. option, input is handled fully in the front-end X server, and the
  160. back-end X servers are used in a display-only mode. This option was
  161. implemented and works for a limited number of Linux-specific
  162. devices. Adding additional local input devices for other
  163. architectures is expected to be relatively simple.
  164. </para>
  165. <para>The following options are available for implementing local input
  166. devices:
  167. <orderedlist>
  168. <listitem>
  169. <para>The XFree86 X server has modular input drivers that could
  170. be adapted for this purpose. The mouse driver supports a wide
  171. range of mouse types and interfaces, as well as a range of
  172. Operating System platforms. The keyboard driver in XFree86 is
  173. not currently as modular as the mouse driver, but could be made
  174. so. The XFree86 X server also has a range of other input
  175. drivers for extended input devices such as tablets and touch
  176. screens. Unfortunately, the XFree86 drivers are generally
  177. complex, often simultaneously providing support for multiple
  178. devices across multiple architectures; and rely so heavily on
  179. XFree86-specific helper-functions, that this option was not
  180. pursued.
  181. </para>
  182. </listitem>
  183. <listitem>
  184. <para>The <command>kdrive</command> X server in XFree86 has built-in drivers that
  185. support PS/2 mice and keyboard under Linux. The mouse driver
  186. can indirectly handle other mouse types if the Linux utility
  187. <command>gpm</command> is used as to translate the native mouse protocol into
  188. PS/2 mouse format. These drivers could be adapted and built in
  189. to the front-end X server if this range of hardware and OS
  190. support is sufficient. While much simpler than the XFree86
  191. drivers, the <command>kdrive</command> drivers were not used for the DMX
  192. implementation.
  193. </para>
  194. </listitem>
  195. <listitem>
  196. <para>Reimplementation of keyboard and mouse drivers from
  197. scratch for the DMX framework. Because keyboard and mouse
  198. drivers are relatively trivial to implement, this pathway was
  199. selected. Other drivers in the X source tree were referenced,
  200. and significant contributions from other drivers are noted in
  201. the DMX source code.
  202. </para>
  203. </listitem>
  204. </orderedlist>
  205. </para>
  206. </listitem>
  207. <listitem>
  208. <para>Backend Input. The front-end can make use of the core input
  209. devices attached to one or more of the back-end X servers. Core
  210. input events from multiple back-ends are merged into a single input
  211. event stream. This can work sanely when only a single set of input
  212. devices is used at any given time. The keyboard and pointer state
  213. will be handled in the front-end, with changes propagated to the
  214. back-end servers as needed. This option was implemented and works
  215. well. Because the core pointer on a back-end controls the hardware
  216. mouse on that back-end, core pointers cannot be treated as XInput
  217. extension devices. However, all back-end XInput extensions devices
  218. can be mapped to either DMX core or DMX XInput extension devices.
  219. </para>
  220. </listitem>
  221. <listitem>
  222. <para>Console Input. The front-end server could create a console
  223. window that is displayed on an X server independent of the back-end
  224. X servers. This console window could display things like the
  225. physical screen layout, and the front-end could get its core input
  226. events from events delivered to the console window. This option was
  227. implemented and works well. To help the human navigate, window
  228. outlines are also displayed in the console window. Further, console
  229. windows can be used as either core or XInput extension devices.
  230. </para>
  231. </listitem>
  232. <listitem>
  233. <para>Other options were initially explored, but they were all
  234. partial subsets of the options listed above and, hence, are
  235. irrelevant.
  236. </para>
  237. </listitem>
  238. </orderedlist>
  239. </para>
  240. <para>Although extended input devices are not specifically mentioned in the
  241. Distributed X requirements, the options above were all implemented so
  242. that XInput extension devices were supported.
  243. </para>
  244. <para>The bootstrap code (Xdmx) had dummy input devices, and these are
  245. still supported in the final version. These do the necessary
  246. initialization to satisfy the X server's requirements for core pointer
  247. and keyboard devices, but no input events are ever generated.
  248. </para>
  249. <para>Status: The input code is complete. Because of the complexity of the
  250. XFree86 input device drivers (and their heavy reliance on XFree86
  251. infrastructure), separate low-level device drivers were implemented for
  252. Xdmx. The following kinds of drivers are supported (in general, the
  253. devices can be treated arbitrarily as "core" input devices or as XInput
  254. "extension" devices; and multiple instances of different kinds of
  255. devices can be simultaneously available):
  256. <orderedlist>
  257. <listitem>
  258. <para> A "dummy" device drive that never generates events.
  259. </para>
  260. </listitem>
  261. <listitem>
  262. <para> "Local" input is from the low-level hardware on which the
  263. Xdmx binary is running. This is the only area where using the
  264. XFree86 driver infrastructure would have been helpful, and then
  265. only partially, since good support for generic USB devices does
  266. not yet exist in XFree86 (in any case, XFree86 and kdrive driver
  267. code was used where possible). Currently, the following local
  268. devices are supported under Linux (porting to other operating
  269. systems should be fairly straightforward):
  270. <itemizedlist>
  271. <listitem><para>Linux keyboard</para></listitem>
  272. <listitem><para>Linux serial mouse (MS)</para></listitem>
  273. <listitem><para>Linux PS/2 mouse</para></listitem>
  274. <listitem><para>USB keyboard</para></listitem>
  275. <listitem><para>USB mouse</para></listitem>
  276. <listitem><para>USB generic device (e.g., joystick, gamepad, etc.)</para></listitem>
  277. </itemizedlist>
  278. </para>
  279. </listitem>
  280. <listitem>
  281. <para> "Backend" input is taken from one or more of the back-end
  282. displays. In this case, events are taken from the back-end X
  283. server and are converted to Xdmx events. Care must be taken so
  284. that the sprite moves properly on the display from which input
  285. is being taken.
  286. </para>
  287. </listitem>
  288. <listitem>
  289. <para> "Console" input is taken from an X window that Xdmx
  290. creates on the operator's display (i.e., on the machine running
  291. the Xdmx binary). When the operator's mouse is inside the
  292. console window, then those events are converted to Xdmx events.
  293. Several special features are available: the console can display
  294. outlines of windows that are on the Xdmx display (to facilitate
  295. navigation), the cursor can be confined to the console, and a
  296. "fine" mode can be activated to allow very precise cursor
  297. positioning.
  298. </para>
  299. </listitem>
  300. </orderedlist>
  301. </para>
  302. </sect2>
  303. <!-- May 2002; July 2003 -->
  304. <sect2>
  305. <title>Output device handling</title>
  306. <para>The output of the DMX system displays rendering and windowing
  307. requests across multiple screens. The screens are typically arranged in
  308. a grid such that together they represent a single large display.
  309. </para>
  310. <para>The output section of the DMX code consists of two parts. The first
  311. is in the front-end proxy X server (Xdmx), which accepts client
  312. connections, manages the windows, and potentially renders primitives but
  313. does not actually display any of the drawing primitives. The second
  314. part is the back-end X server(s), which accept commands from the
  315. front-end server and display the results on their screens.
  316. </para>
  317. <sect3>
  318. <title>Initialization</title>
  319. <para>The DMX front-end must first initialize its screens by connecting to
  320. each of the back-end X servers and collecting information about each of
  321. these screens. However, the information collected from the back-end X
  322. servers might be inconsistent. Handling these cases can be difficult
  323. and/or inefficient. For example, a two screen system has one back-end X
  324. server running at 16bpp while the second is running at 32bpp.
  325. Converting rendering requests (e.g., XPutImage() or XGetImage()
  326. requests) to the appropriate bit depth can be very time consuming.
  327. Analyzing these cases to determine how or even if it is possible to
  328. handle them is required. The current Xinerama code handles many of
  329. these cases (e.g., in PanoramiXConsolidate()) and will be used as a
  330. starting point. In general, the best solution is to use homogeneous X
  331. servers and display devices. Using back-end servers with the same depth
  332. is a requirement of the final DMX implementation.
  333. </para>
  334. <para>Once this screen consolidation is finished, the relative position of
  335. each back-end X server's screen in the unified screen is initialized. A
  336. full-screen window is opened on each of the back-end X servers, and the
  337. cursor on each screen is turned off. The final DMX implementation can
  338. also make use of a partial-screen window, or multiple windows per
  339. back-end screen.
  340. </para>
  341. </sect3>
  342. <sect3>
  343. <title>Handling rendering requests</title>
  344. <para>After initialization, X applications connect to the front-end server.
  345. There are two possible implementations of how rendering and windowing
  346. requests are handled in the DMX system:
  347. <orderedlist>
  348. <listitem>
  349. <para>A shadow framebuffer is used in the front-end server as the
  350. render target. In this option, all protocol requests are completely
  351. handled in the front-end server. All state and resources are
  352. maintained in the front-end including a shadow copy of the entire
  353. framebuffer. The framebuffers attached to the back-end servers are
  354. updated by XPutImage() calls with data taken directly from the
  355. shadow framebuffer.
  356. </para>
  357. <para>This solution suffers from two main problems. First, it does not
  358. take advantage of any accelerated hardware available in the system.
  359. Second, the size of the XPutImage() calls can be quite large and
  360. thus will be limited by the bandwidth available.
  361. </para>
  362. <para>The initial DMX implementation used a shadow framebuffer by
  363. default.
  364. </para>
  365. </listitem>
  366. <listitem>
  367. <para>Rendering requests are sent to each back-end server for
  368. handling (as is done in the Xnest server described above). In this
  369. option, certain protocol requests are handled in the front-end
  370. server and certain requests are repackaged and then sent to the
  371. back-end servers. The framebuffer is distributed across the
  372. multiple back-end servers. Rendering to the framebuffer is handled
  373. on each back-end and can take advantage of any acceleration
  374. available on the back-end servers' graphics display device. State
  375. is maintained both in the front and back-end servers.
  376. </para>
  377. <para>This solution suffers from two main drawbacks. First, protocol
  378. requests are sent to all back-end servers -- even those that will
  379. completely clip the rendering primitive -- which wastes bandwidth
  380. and processing time. Second, state is maintained both in the front-
  381. and back-end servers. These drawbacks are not as severe as in
  382. option 1 (above) and can either be overcome through optimizations or
  383. are acceptable. Therefore, this option will be used in the final
  384. implementation.
  385. </para>
  386. <para>The final DMX implementation defaults to this mechanism, but also
  387. supports the shadow framebuffer mechanism. Several optimizations
  388. were implemented to eliminate the drawbacks of the default
  389. mechanism. These optimizations are described the section below and
  390. in Phase II of the Development Results (see appendix).
  391. </para>
  392. </listitem>
  393. </orderedlist>
  394. </para>
  395. <para>Status: Both the shadow framebuffer and Xnest-style code is complete.
  396. <!-- May 2002 -->
  397. </para>
  398. </sect3>
  399. </sect2>
  400. <sect2>
  401. <title>Optimizing DMX</title>
  402. <para>Initially, the Xnest-style solution's performance will be measured
  403. and analyzed to determine where the performance bottlenecks exist.
  404. There are four main areas that will be addressed.
  405. </para>
  406. <para>First, to obtain reasonable interactivity with the first development
  407. phase, XSync() was called after each protocol request. The XSync()
  408. function flushes any pending protocol requests. It then waits for the
  409. back-end to process the request and send a reply that the request has
  410. completed. This happens with each back-end server and performance
  411. greatly suffers. As a result of the way XSync() is called in the first
  412. development phase, the batching that the X11 library performs is
  413. effectively defeated. The XSync() call usage will be analyzed and
  414. optimized by batching calls and performing them at regular intervals,
  415. except where interactivity will suffer (e.g., on cursor movements).
  416. </para>
  417. <para>Second, the initial Xnest-style solution described above sends the
  418. repackaged protocol requests to all back-end servers regardless of
  419. whether or not they would be completely clipped out. The requests that
  420. are trivially rejected on the back-end server wastes the limited
  421. bandwidth available. By tracking clipping changes in the DMX X server's
  422. windowing code (e.g., by opening, closing, moving or resizing windows),
  423. we can determine whether or not back-end windows are visible so that
  424. trivial tests in the front-end server's GC ops drawing functions can
  425. eliminate these unnecessary protocol requests.
  426. </para>
  427. <para>Third, each protocol request will be analyzed to determine if it is
  428. possible to break the request into smaller pieces at display boundaries.
  429. The initial ones to be analyzed are put and get image requests since
  430. they will require the greatest bandwidth to transmit data between the
  431. front and back-end servers. Other protocol requests will be analyzed
  432. and those that will benefit from breaking them into smaller requests
  433. will be implemented.
  434. </para>
  435. <para>Fourth, an extension is being considered that will allow font glyphs to
  436. be transferred from the front-end DMX X server to each back-end server.
  437. This extension will permit the front-end to handle all font requests and
  438. eliminate the requirement that all back-end X servers share the exact
  439. same fonts as the front-end server. We are investigating the
  440. feasibility of this extension during this development phase.
  441. </para>
  442. <para>Other potential optimizations will be determined from the performance
  443. analysis.
  444. </para>
  445. <para>Please note that in our initial design, we proposed optimizing BLT
  446. operations (e.g., XCopyArea() and window moves) by developing an
  447. extension that would allow individual back-end servers to directly copy
  448. pixel data to other back-end servers. This potential optimization was
  449. in response to the simple image movement implementation that required
  450. potentially many calls to GetImage() and PutImage(). However, the
  451. current Xinerama implementation handles these BLT operations
  452. differently. Instead of copying data to and from screens, they generate
  453. expose events -- just as happens in the case when a window is moved from
  454. off a screen to on screen. This approach saves the limited bandwidth
  455. available between front and back-end servers and is being standardized
  456. with Xinerama. It also eliminates the potential setup problems and
  457. security issues resulting from having each back-end server open
  458. connections to all other back-end servers. Therefore, we suggest
  459. accepting Xinerama's expose event solution.
  460. </para>
  461. <para>Also note that the approach proposed in the second and third
  462. optimizations might cause backing store algorithms in the back-end to be
  463. defeated, so a DMX X server configuration flag will be added to disable
  464. these optimizations.
  465. </para>
  466. <para>Status: The optimizations proposed above are complete. It was
  467. determined that the using the xfs font server was sufficient and
  468. creating a new mechanism to pass glyphs was redundant; therefore, the
  469. fourth optimization proposed above was not included in DMX.
  470. <!-- September 2002 -->
  471. </para>
  472. </sect2>
  473. <sect2>
  474. <title>DMX X extension support</title>
  475. <para>The DMX X server keeps track of all the windowing information on the
  476. back-end X servers, but does not currently export this information to
  477. any client applications. An extension will be developed to pass the
  478. screen information and back-end window IDs to DMX-aware clients. These
  479. clients can then use this information to directly connect to and render
  480. to the back-end windows. Bypassing the DMX X server allows DMX-aware
  481. clients to break up complex rendering requests on their own and send
  482. them directly to the windows on the back-end server's screens. An
  483. example of a client that can make effective use of this extension is
  484. Chromium.
  485. </para>
  486. <para>Status: The extension, as implemented, is fully documented in
  487. "Client-to-Server DMX Extension to the X Protocol". Future changes
  488. might be required based on feedback and other proposed enhancements to
  489. DMX. Currently, the following facilities are supported:
  490. <orderedlist>
  491. <listitem><para>
  492. Screen information (clipping rectangle for each screen relative
  493. to the virtual screen)
  494. </para></listitem>
  495. <listitem><para>
  496. Window information (window IDs and clipping information for each
  497. back-end window that corresponds to each DMX window)
  498. </para></listitem>
  499. <listitem><para>
  500. Input device information (mappings from DMX device IDs to
  501. back-end device IDs)
  502. </para></listitem>
  503. <listitem><para>
  504. Force window creation (so that a client can override the
  505. server-side lazy window creation optimization)
  506. </para></listitem>
  507. <listitem><para>
  508. Reconfiguration (so that a client can request that a screen
  509. position be changed)
  510. </para></listitem>
  511. <listitem><para>
  512. Addition and removal of back-end servers and back-end and
  513. console inputs.
  514. </para></listitem>
  515. </orderedlist>
  516. </para>
  517. <!-- September 2002; July 2003 -->
  518. </sect2>
  519. <sect2>
  520. <title>Common X extension support</title>
  521. <para>The XInput, XKeyboard and Shape extensions are commonly used
  522. extensions to the base X11 protocol. XInput allows multiple and
  523. non-standard input devices to be accessed simultaneously. These input
  524. devices can be connected to either the front-end or back-end servers.
  525. XKeyboard allows much better keyboard mappings control. Shape adds
  526. support for arbitrarily shaped windows and is used by various window
  527. managers. Nearly all potential back-end X servers make these extensions
  528. available, and support for each one will be added to the DMX system.
  529. </para>
  530. <para>In addition to the extensions listed above, support for the X
  531. Rendering extension (Render) is being developed. Render adds digital
  532. image composition to the rendering model used by the X Window System.
  533. While this extension is still under development by Keith Packard of HP,
  534. support for the current version will be added to the DMX system.
  535. </para>
  536. <para>Support for the XTest extension was added during the first
  537. development phase.
  538. </para>
  539. <!-- WARNING: this list is duplicated in the Phase IV discussion -->
  540. <para>Status: The following extensions are supported and are discussed in
  541. more detail in Phase IV of the Development Results (see appendix):
  542. BIG-REQUESTS,
  543. DEC-XTRAP,
  544. DMX,
  545. DPMS,
  546. Extended-Visual-Information,
  547. GLX,
  548. LBX,
  549. RECORD,
  550. RENDER,
  551. SECURITY,
  552. SHAPE,
  553. SYNC,
  554. X-Resource,
  555. XC-APPGROUP,
  556. XC-MISC,
  557. XFree86-Bigfont,
  558. XINERAMA,
  559. XInputExtension,
  560. XKEYBOARD, and
  561. XTEST.
  562. <!-- November 2002; updated February 2003, July 2003 -->
  563. </para>
  564. </sect2>
  565. <sect2>
  566. <title>OpenGL support</title>
  567. <para>OpenGL support using the Mesa code base exists in XFree86 release 4
  568. and later. Currently, the direct rendering infrastructure (DRI)
  569. provides accelerated OpenGL support for local clients and unaccelerated
  570. OpenGL support (i.e., software rendering) is provided for non-local
  571. clients.
  572. </para>
  573. <para>The single head OpenGL support in XFree86 4.x will be extended to use
  574. the DMX system. When the front and back-end servers are on the same
  575. physical hardware, it is possible to use the DRI to directly render to
  576. the back-end servers. First, the existing DRI will be extended to
  577. support multiple display heads, and then to support the DMX system.
  578. OpenGL rendering requests will be direct rendering to each back-end X
  579. server. The DRI will request the screen layout (either from the
  580. existing Xinerama extension or a DMX-specific extension). Support for
  581. synchronized swap buffers will also be added (on hardware that supports
  582. it). Note that a single front-end server with a single back-end server
  583. on the same physical machine can emulate accelerated indirect rendering.
  584. </para>
  585. <para>When the front and back-end servers are on different physical
  586. hardware or are using non-XFree86 4.x X servers, a mechanism to render
  587. primitives across the back-end servers will be provided. There are
  588. several options as to how this can be implemented.
  589. </para>
  590. <orderedlist>
  591. <listitem>
  592. <para>The existing OpenGL support in each back-end server can be
  593. used by repackaging rendering primitives and sending them to each
  594. back-end server. This option is similar to the unoptimized
  595. Xnest-style approach mentioned above. Optimization of this solution
  596. is beyond the scope of this project and is better suited to other
  597. distributed rendering systems.
  598. </para></listitem>
  599. <listitem>
  600. <para>Rendering to a pixmap in the front-end server using the
  601. current XFree86 4.x code, and then displaying to the back-ends via
  602. calls to XPutImage() is another option. This option is similar to
  603. the shadow frame buffer approach mentioned above. It is slower and
  604. bandwidth intensive, but has the advantage that the back-end servers
  605. are not required to have OpenGL support.
  606. </para></listitem>
  607. </orderedlist>
  608. <para>These, and other, options will be investigated in this phase of the
  609. work.
  610. </para>
  611. <para>Work by others have made Chromium DMX-aware. Chromium will use the
  612. DMX X protocol extension to obtain information about the back-end
  613. servers and will render directly to those servers, bypassing DMX.
  614. </para>
  615. <para>Status: OpenGL support by the glxProxy extension was implemented by
  616. SGI and has been integrated into the DMX code base.
  617. </para>
  618. <!-- May 2003-->
  619. </sect2>
  620. </sect1>
  621. <!-- ============================================================ -->
  622. <sect1>
  623. <title>Current issues</title>
  624. <para>In this sections the current issues are outlined that require further
  625. investigation.
  626. </para>
  627. <sect2>
  628. <title>Fonts</title>
  629. <para>The font path and glyphs need to be the same for the front-end and
  630. each of the back-end servers. Font glyphs could be sent to the back-end
  631. servers as necessary but this would consume a significant amount of
  632. available bandwidth during font rendering for clients that use many
  633. different fonts (e.g., Netscape). Initially, the font server (xfs) will
  634. be used to provide the fonts to both the front-end and back-end servers.
  635. Other possibilities will be investigated during development.
  636. </para>
  637. </sect2>
  638. <sect2>
  639. <title>Zero width rendering primitives</title>
  640. <para>To allow pixmap and on-screen rendering to be pixel perfect, all
  641. back-end servers must render zero width primitives exactly the same as
  642. the front-end renders the primitives to pixmaps. For those back-end
  643. servers that do not exactly match, zero width primitives will be
  644. automatically converted to one width primitives. This can be handled in
  645. the front-end server via the GC state.
  646. </para>
  647. </sect2>
  648. <sect2>
  649. <title>Output scaling</title>
  650. <para>With very large tiled displays, it might be difficult to read the
  651. information on the standard X desktop. In particular, the cursor can be
  652. easily lost and fonts could be difficult to read. Automatic primitive
  653. scaling might prove to be very useful. We will investigate the
  654. possibility of scaling the cursor and providing a set of alternate
  655. pre-scaled fonts to replace the standard fonts that many applications
  656. use (e.g., fixed). Other options for automatic scaling will also be
  657. investigated.
  658. </para>
  659. </sect2>
  660. <sect2>
  661. <title>Per-screen colormaps</title>
  662. <para>Each screen's default colormap in the set of back-end X servers
  663. should be able to be adjusted via a configuration utility. This support
  664. is would allow the back-end screens to be calibrated via custom gamma
  665. tables. On 24-bit systems that support a DirectColor visual, this type
  666. of correction can be accommodated. One possible implementation would be
  667. to advertise to X client of the DMX server a TrueColor visual while
  668. using DirectColor visuals on the back-end servers to implement this type
  669. of color correction. Other options will be investigated.
  670. </para>
  671. </sect2>
  672. </sect1>
  673. <!-- ============================================================ -->
  674. <appendix>
  675. <title>Appendix</title>
  676. <sect1>
  677. <title>Background</title>
  678. <para>This section describes the existing Open Source architectures that
  679. can be used to handle multiple screens and upon which this development
  680. project is based. This section was written before the implementation
  681. was finished, and may not reflect actual details of the implementation.
  682. It is left for historical interest only.
  683. </para>
  684. <sect2>
  685. <title>Core input device handling</title>
  686. <para>The following is a description of how core input devices are handled
  687. by an X server.
  688. </para>
  689. <sect3>
  690. <title>InitInput()</title>
  691. <para>InitInput() is a DDX function that is called at the start of each
  692. server generation from the X server's main() function. Its purpose is
  693. to determine what input devices are connected to the X server, register
  694. them with the DIX and MI layers, and initialize the input event queue.
  695. InitInput() does not have a return value, but the X server will abort if
  696. either a core keyboard device or a core pointer device are not
  697. registered. Extended input (XInput) devices can also be registered in
  698. InitInput().
  699. </para>
  700. <para>InitInput() usually has implementation specific code to determine
  701. which input devices are available. For each input device it will be
  702. using, it calls AddInputDevice():
  703. <variablelist>
  704. <varlistentry>
  705. <term>AddInputDevice()</term>
  706. <listitem><para>This DIX function allocates the device structure,
  707. registers a callback function (which handles device init, close, on and
  708. off), and returns the input handle, which can be treated as opaque. It
  709. is called once for each input device.
  710. </para></listitem>
  711. </varlistentry>
  712. </variablelist>
  713. </para>
  714. <para>Once input handles for core keyboard and core pointer devices have
  715. been obtained from AddInputDevice(). If both core devices are not
  716. registered, then the X server will exit with a fatal error when it
  717. attempts to start the input devices in InitAndStartDevices(), which is
  718. called directly after InitInput() (see below).
  719. </para>
  720. <para>The core pointer device is then registered with the miPointer code
  721. (which does the high level cursor handling). While this registration
  722. is not necessary for correct miPointer operation in the current XFree86
  723. code, it is still done mostly for compatibility reasons.
  724. </para>
  725. <para><variablelist>
  726. <varlistentry>
  727. <term>miRegisterPointerDevice()</term>
  728. <listitem><para>This MI function registers the core
  729. pointer's input handle with with the miPointer code.
  730. </para></listitem></varlistentry>
  731. </variablelist>
  732. </para>
  733. <para>The final part of InitInput() is the initialization of the input
  734. event queue handling. In most cases, the event queue handling provided
  735. in the MI layer is used. The primary XFree86 X server uses its own
  736. event queue handling to support some special cases related to the XInput
  737. extension and the XFree86-specific DGA extension. For our purposes, the
  738. MI event queue handling should be suitable. It is initialized by
  739. calling mieqInit():
  740. <variablelist>
  741. <varlistentry>
  742. <term>mieqInit()</term>
  743. <listitem><para>This MI function initializes the MI event queue for the
  744. core devices, and is passed the public component of the input handles
  745. for the two core devices.
  746. </para></listitem></varlistentry>
  747. </variablelist>
  748. </para>
  749. <para>If a wakeup handler is required to deliver synchronous input
  750. events, it can be registered here by calling the DIX function
  751. RegisterBlockAndWakeupHandlers(). (See the devReadInput() description
  752. below.)
  753. </para>
  754. </sect3>
  755. <sect3>
  756. <title>InitAndStartDevices()</title>
  757. <para>InitAndStartDevices() is a DIX function that is called immediately
  758. after InitInput() from the X server's main() function. Its purpose is
  759. to initialize each input device that was registered with
  760. AddInputDevice(), enable each input device that was successfully
  761. initialized, and create the list of enabled input devices. Once each
  762. registered device is processed in this way, the list of enabled input
  763. devices is checked to make sure that both a core keyboard device and
  764. core pointer device were registered and successfully enabled. If not,
  765. InitAndStartDevices() returns failure, and results in the the X server
  766. exiting with a fatal error.
  767. </para>
  768. <para>Each registered device is initialized by calling its callback
  769. (dev-&gt;deviceProc) with the DEVICE_INIT argument:
  770. <variablelist>
  771. <varlistentry>
  772. <term>(*dev-&gt;deviceProc)(dev, DEVICE_INIT)</term>
  773. <listitem>
  774. <para>This function initializes the
  775. device structs with core information relevant to the device.
  776. </para>
  777. <para>For pointer devices, this means specifying the number of buttons,
  778. default button mapping, the function used to get motion events (usually
  779. miPointerGetMotionEvents()), the function used to change/control the
  780. core pointer motion parameters (acceleration and threshold), and the
  781. motion buffer size.
  782. </para>
  783. <para>For keyboard devices, this means specifying the keycode range,
  784. default keycode to keysym mapping, default modifier mapping, and the
  785. functions used to sound the keyboard bell and modify/control the
  786. keyboard parameters (LEDs, bell pitch and duration, key click, which
  787. keys are auto-repeating, etc).
  788. </para></listitem></varlistentry>
  789. </variablelist>
  790. </para>
  791. <para>Each initialized device is enabled by calling EnableDevice():
  792. <variablelist>
  793. <varlistentry>
  794. <term>EnableDevice()</term>
  795. <listitem>
  796. <para>EnableDevice() calls the device callback with
  797. DEVICE_ON:
  798. <variablelist>
  799. <varlistentry>
  800. <term>(*dev-&gt;deviceProc)(dev, DEVICE_ON)</term>
  801. <listitem>
  802. <para>This typically opens and
  803. initializes the relevant physical device, and when appropriate,
  804. registers the device's file descriptor (or equivalent) as a valid
  805. input source.
  806. </para></listitem></varlistentry>
  807. </variablelist>
  808. </para>
  809. <para>EnableDevice() then adds the device handle to the X server's
  810. global list of enabled devices.
  811. </para></listitem></varlistentry>
  812. </variablelist>
  813. </para>
  814. <para>InitAndStartDevices() then verifies that a valid core keyboard and
  815. pointer has been initialized and enabled. It returns failure if either
  816. are missing.
  817. </para>
  818. </sect3>
  819. <sect3>
  820. <title>devReadInput()</title>
  821. <para>Each device will have some function that gets called to read its
  822. physical input. These may be called in a number of different ways. In
  823. the case of synchronous I/O, they will be called from a DDX
  824. wakeup-handler that gets called after the server detects that new input is
  825. available. In the case of asynchronous I/O, they will be called from a
  826. (SIGIO) signal handler triggered when new input is available. This
  827. function should do at least two things: make sure that input events get
  828. enqueued, and make sure that the cursor gets moved for motion events
  829. (except if these are handled later by the driver's own event queue
  830. processing function, which cannot be done when using the MI event queue
  831. handling).
  832. </para>
  833. <para>Events are queued by calling mieqEnqueue():
  834. <variablelist>
  835. <varlistentry>
  836. <term>mieqEnqueue()</term>
  837. <listitem>
  838. <para>This MI function is used to add input events to the
  839. event queue. It is simply passed the event to be queued.
  840. </para></listitem></varlistentry>
  841. </variablelist>
  842. </para>
  843. <para>The cursor position should be updated when motion events are
  844. enqueued by calling miPointerDeltaCursor():
  845. <variablelist>
  846. <varlistentry>
  847. <term>miPointerDeltaCursor()</term>
  848. <listitem>
  849. <para>This MI function is used to move the cursor
  850. relative to its current position.
  851. </para></listitem></varlistentry>
  852. </variablelist>
  853. </para>
  854. </sect3>
  855. <sect3>
  856. <title>ProcessInputEvents()</title>
  857. <para>ProcessInputEvents() is a DDX function that is called from the X
  858. server's main dispatch loop when new events are available in the input
  859. event queue. It typically processes the enqueued events, and updates
  860. the cursor/pointer position. It may also do other DDX-specific event
  861. processing.
  862. </para>
  863. <para>Enqueued events are processed by mieqProcessInputEvents() and passed
  864. to the DIX layer for transmission to clients:
  865. <variablelist>
  866. <varlistentry>
  867. <term>mieqProcessInputEvents()</term>
  868. <listitem>
  869. <para>This function processes each event in the
  870. event queue, and passes it to the device's input processing function.
  871. The DIX layer provides default functions to do this processing, and they
  872. handle the task of getting the events passed back to the relevant
  873. clients.
  874. </para></listitem></varlistentry>
  875. <varlistentry>
  876. <term>miPointerUpdate()</term>
  877. <listitem>
  878. <para>This function resynchronized the cursor position
  879. with the new pointer position. It also takes care of moving the cursor
  880. between screens when needed in multi-head configurations.
  881. </para></listitem></varlistentry>
  882. </variablelist>
  883. </para>
  884. </sect3>
  885. <sect3>
  886. <title>DisableDevice()</title>
  887. <para>DisableDevice is a DIX function that removes an input device from the
  888. list of enabled devices. The result of this is that the device no
  889. longer generates input events. The device's data structures are kept in
  890. place, and disabling a device like this can be reversed by calling
  891. EnableDevice(). DisableDevice() may be called from the DDX when it is
  892. desirable to do so (e.g., the XFree86 server does this when VT
  893. switching). Except for special cases, this is not normally called for
  894. core input devices.
  895. </para>
  896. <para>DisableDevice() calls the device's callback function with
  897. <constant>DEVICE_OFF</constant>:
  898. <variablelist>
  899. <varlistentry>
  900. <term>(*dev-&gt;deviceProc)(dev, DEVICE_OFF)</term>
  901. <listitem>
  902. <para>This typically closes the
  903. relevant physical device, and when appropriate, unregisters the device's
  904. file descriptor (or equivalent) as a valid input source.
  905. </para></listitem></varlistentry>
  906. </variablelist>
  907. </para>
  908. <para>DisableDevice() then removes the device handle from the X server's
  909. global list of enabled devices.
  910. </para>
  911. </sect3>
  912. <sect3>
  913. <title>CloseDevice()</title>
  914. <para>CloseDevice is a DIX function that removes an input device from the
  915. list of available devices. It disables input from the device and frees
  916. all data structures associated with the device. This function is
  917. usually called from CloseDownDevices(), which is called from main() at
  918. the end of each server generation to close all input devices.
  919. </para>
  920. <para>CloseDevice() calls the device's callback function with
  921. <constant>DEVICE_CLOSE</constant>:
  922. <variablelist>
  923. <varlistentry>
  924. <term>(*dev-&gt;deviceProc)(dev, DEVICE_CLOSE)</term>
  925. <listitem>
  926. <para>This typically closes the
  927. relevant physical device, and when appropriate, unregisters the device's
  928. file descriptor (or equivalent) as a valid input source. If any device
  929. specific data structures were allocated when the device was initialized,
  930. they are freed here.
  931. </para></listitem></varlistentry>
  932. </variablelist>
  933. </para>
  934. <para>CloseDevice() then frees the data structures that were allocated
  935. for the device when it was registered/initialized.
  936. </para>
  937. </sect3>
  938. <sect3>
  939. <title>LegalModifier()</title>
  940. <!-- dmx/dmxinput.c - currently returns TRUE -->
  941. <para>LegalModifier() is a required DDX function that can be used to
  942. restrict which keys may be modifier keys. This seems to be present for
  943. historical reasons, so this function should simply return TRUE
  944. unconditionally.
  945. </para>
  946. </sect3>
  947. </sect2>
  948. <sect2>
  949. <title>Output handling</title>
  950. <para>The following sections describe the main functions required to
  951. initialize, use and close the output device(s) for each screen in the X
  952. server.
  953. </para>
  954. <sect3>
  955. <title>InitOutput()</title>
  956. <para>This DDX function is called near the start of each server generation
  957. from the X server's main() function. InitOutput()'s main purpose is to
  958. initialize each screen and fill in the global screenInfo structure for
  959. each screen. It is passed three arguments: a pointer to the screenInfo
  960. struct, which it is to initialize, and argc and argv from main(), which
  961. can be used to determine additional configuration information.
  962. </para>
  963. <para>The primary tasks for this function are outlined below:
  964. <orderedlist>
  965. <listitem>
  966. <para><emphasis remap="bf">Parse configuration info:</emphasis> The first task of InitOutput()
  967. is to parses any configuration information from the configuration
  968. file. In addition to the XF86Config file, other configuration
  969. information can be taken from the command line. The command line
  970. options can be gathered either in InitOutput() or earlier in the
  971. ddxProcessArgument() function, which is called by
  972. ProcessCommandLine(). The configuration information determines the
  973. characteristics of the screen(s). For example, in the XFree86 X
  974. server, the XF86Config file specifies the monitor information, the
  975. screen resolution, the graphics devices and slots in which they are
  976. located, and, for Xinerama, the screens' layout.
  977. </para>
  978. </listitem>
  979. <listitem>
  980. <para><emphasis remap="bf">Initialize screen info:</emphasis> The next task is to initialize
  981. the screen-dependent internal data structures. For example, part of
  982. what the XFree86 X server does is to allocate its screen and pixmap
  983. private indices, probe for graphics devices, compare the probed
  984. devices to the ones listed in the XF86Config file, and add the ones that
  985. match to the internal xf86Screens&lsqb;&rsqb; structure.
  986. </para>
  987. </listitem>
  988. <listitem>
  989. <para><emphasis remap="bf">Set pixmap formats:</emphasis> The next task is to initialize the
  990. screenInfo's image byte order, bitmap bit order and bitmap scanline
  991. unit/pad. The screenInfo's pixmap format's depth, bits per pixel
  992. and scanline padding is also initialized at this stage.
  993. </para>
  994. </listitem>
  995. <listitem>
  996. <para><emphasis remap="bf">Unify screen info:</emphasis> An optional task that might be done at
  997. this stage is to compare all of the information from the various
  998. screens and determines if they are compatible (i.e., if the set of
  999. screens can be unified into a single desktop). This task has
  1000. potential to be useful to the DMX front-end server, if Xinerama's
  1001. PanoramiXConsolidate() function is not sufficient.
  1002. </para>
  1003. </listitem>
  1004. </orderedlist>
  1005. </para>
  1006. <para>Once these tasks are complete, the valid screens are known and each
  1007. of these screens can be initialized by calling AddScreen().
  1008. </para>
  1009. </sect3>
  1010. <sect3>
  1011. <title>AddScreen()</title>
  1012. <para>This DIX function is called from InitOutput(), in the DDX layer, to
  1013. add each new screen to the screenInfo structure. The DDX screen
  1014. initialization function and command line arguments (i.e., argc and argv)
  1015. are passed to it as arguments.
  1016. </para>
  1017. <para>This function first allocates a new Screen structure and any privates
  1018. that are required. It then initializes some of the fields in the Screen
  1019. struct and sets up the pixmap padding information. Finally, it calls
  1020. the DDX screen initialization function ScreenInit(), which is described
  1021. below. It returns the number of the screen that were just added, or -1
  1022. if there is insufficient memory to add the screen or if the DDX screen
  1023. initialization fails.
  1024. </para>
  1025. </sect3>
  1026. <sect3>
  1027. <title>ScreenInit()</title>
  1028. <para>This DDX function initializes the rest of the Screen structure with
  1029. either generic or screen-specific functions (as necessary). It also
  1030. fills in various screen attributes (e.g., width and height in
  1031. millimeters, black and white pixel values).
  1032. </para>
  1033. <para>The screen init function usually calls several functions to perform
  1034. certain screen initialization functions. They are described below:
  1035. <variablelist>
  1036. <varlistentry>
  1037. <term>{mi,*fb}ScreenInit()</term>
  1038. <listitem>
  1039. <para>The DDX layer's ScreenInit() function usually
  1040. calls another layer's ScreenInit() function (e.g., miScreenInit() or
  1041. fbScreenInit()) to initialize the fallbacks that the DDX driver does not
  1042. specifically handle.
  1043. </para>
  1044. <para>After calling another layer's ScreenInit() function, any
  1045. screen-specific functions either wrap or replace the other layer's
  1046. function pointers. If a function is to be wrapped, each of the old
  1047. function pointers from the other layer are stored in a screen private
  1048. area. Common functions to wrap are CloseScreen() and SaveScreen().
  1049. </para></listitem></varlistentry>
  1050. <varlistentry>
  1051. <term>miDCInitialize()</term>
  1052. <listitem>
  1053. <para>This MI function initializes the MI cursor
  1054. display structures and function pointers. If a hardware cursor is used,
  1055. the DDX layer's ScreenInit() function will wrap additional screen and
  1056. the MI cursor display function pointers.
  1057. </para></listitem></varlistentry>
  1058. </variablelist>
  1059. </para>
  1060. <para>Another common task for ScreenInit() function is to initialize the
  1061. output device state. For example, in the XFree86 X server, the
  1062. ScreenInit() function saves the original state of the video card and
  1063. then initializes the video mode of the graphics device.
  1064. </para>
  1065. </sect3>
  1066. <sect3>
  1067. <title>CloseScreen()</title>
  1068. <para>This function restores any wrapped screen functions (and in
  1069. particular the wrapped CloseScreen() function) and restores the state of
  1070. the output device to its original state. It should also free any
  1071. private data it created during the screen initialization.
  1072. </para>
  1073. </sect3>
  1074. <sect3>
  1075. <title>GC operations</title>
  1076. <para>When the X server is requested to render drawing primitives, it does
  1077. so by calling drawing functions through the graphics context's operation
  1078. function pointer table (i.e., the GCOps functions). These functions
  1079. render the basic graphics operations such as drawing rectangles, lines,
  1080. text or copying pixmaps. Default routines are provided either by the MI
  1081. layer, which draws indirectly through a simple span interface, or by the
  1082. framebuffer layers (e.g., CFB, MFB, FB), which draw directly to a
  1083. linearly mapped frame buffer.
  1084. </para>
  1085. <para>To take advantage of special hardware on the graphics device,
  1086. specific GCOps functions can be replaced by device specific code.
  1087. However, many times the graphics devices can handle only a subset of the
  1088. possible states of the GC, so during graphics context validation,
  1089. appropriate routines are selected based on the state and capabilities of
  1090. the hardware. For example, some graphics hardware can accelerate single
  1091. pixel width lines with certain dash patterns. Thus, for dash patterns
  1092. that are not supported by hardware or for width 2 or greater lines, the
  1093. default routine is chosen during GC validation.
  1094. </para>
  1095. <para>Note that some pointers to functions that draw to the screen are
  1096. stored in the Screen structure. They include GetImage(), GetSpans(),
  1097. CopyWindow() and RestoreAreas().
  1098. </para>
  1099. </sect3>
  1100. <sect3>
  1101. <title>Xnest</title>
  1102. <para>The Xnest X server is a special proxy X server that relays the X
  1103. protocol requests that it receives to a ``real'' X server that then
  1104. processes the requests and displays the results, if applicable. To the X
  1105. applications, Xnest appears as if it is a regular X server. However,
  1106. Xnest is both server to the X application and client of the real X
  1107. server, which will actually handle the requests.
  1108. </para>
  1109. <para>The Xnest server implements all of the standard input and output
  1110. initialization steps outlined above.
  1111. </para>
  1112. <para><variablelist>
  1113. <varlistentry>
  1114. <term>InitOutput()</term>
  1115. <listitem>
  1116. <para>Xnest takes its configuration information from
  1117. command line arguments via ddxProcessArguments(). This information
  1118. includes the real X server display to connect to, its default visual
  1119. class, the screen depth, the Xnest window's geometry, etc. Xnest then
  1120. connects to the real X server and gathers visual, colormap, depth and
  1121. pixmap information about that server's display, creates a window on that
  1122. server, which will be used as the root window for Xnest.
  1123. </para>
  1124. <para>Next, Xnest initializes its internal data structures and uses the
  1125. data from the real X server's pixmaps to initialize its own pixmap
  1126. formats. Finally, it calls AddScreen(xnestOpenScreen, argc, argv) to
  1127. initialize each of its screens.
  1128. </para></listitem></varlistentry>
  1129. <varlistentry>
  1130. <term>ScreenInit()</term>
  1131. <listitem>
  1132. <para>Xnest's ScreenInit() function is called
  1133. xnestOpenScreen(). This function initializes its screen's depth and
  1134. visual information, and then calls miScreenInit() to set up the default
  1135. screen functions. It then calls miDCInitialize() to initialize the
  1136. software cursor.
  1137. Finally, it replaces many of the screen functions with its own
  1138. functions that repackage and send the requests to the real X server to
  1139. which Xnest is attached.
  1140. </para></listitem></varlistentry>
  1141. <varlistentry>
  1142. <term>CloseScreen()</term>
  1143. <listitem>
  1144. <para>This function frees its internal data structure
  1145. allocations. Since it replaces instead of wrapping screen functions,
  1146. there are no function pointers to unwrap. This can potentially lead to
  1147. problems during server regeneration.
  1148. </para></listitem></varlistentry>
  1149. <varlistentry>
  1150. <term>GC operations</term>
  1151. <listitem>
  1152. <para>The GC operations in Xnest are very simple since
  1153. they leave all of the drawing to the real X server to which Xnest is
  1154. attached. Each of the GCOps takes the request and sends it to the
  1155. real X server using standard Xlib calls. For example, the X
  1156. application issues a XDrawLines() call. This function turns into a
  1157. protocol request to Xnest, which calls the xnestPolylines() function
  1158. through Xnest's GCOps function pointer table. The xnestPolylines()
  1159. function is only a single line, which calls XDrawLines() using the same
  1160. arguments that were passed into it. Other GCOps functions are very
  1161. similar. Two exceptions to the simple GCOps functions described above
  1162. are the image functions and the BLT operations.
  1163. </para>
  1164. <para>The image functions, GetImage() and PutImage(), must use a temporary
  1165. image to hold the image to be put of the image that was just grabbed
  1166. from the screen while it is in transit to the real X server or the
  1167. client. When the image has been transmitted, the temporary image is
  1168. destroyed.
  1169. </para>
  1170. <para>The BLT operations, CopyArea() and CopyPlane(), handle not only the
  1171. copy function, which is the same as the simple cases described above,
  1172. but also the graphics exposures that result when the GC's graphics
  1173. exposure bit is set to True. Graphics exposures are handled in a helper
  1174. function, xnestBitBlitHelper(). This function collects the exposure
  1175. events from the real X server and, if any resulting in regions being
  1176. exposed, then those regions are passed back to the MI layer so that it
  1177. can generate exposure events for the X application.
  1178. </para></listitem></varlistentry>
  1179. </variablelist>
  1180. </para>
  1181. <para>The Xnest server takes its input from the X server to which it is
  1182. connected. When the mouse is in the Xnest server's window, keyboard and
  1183. mouse events are received by the Xnest server, repackaged and sent back
  1184. to any client that requests those events.
  1185. </para>
  1186. </sect3>
  1187. <sect3>
  1188. <title>Shadow framebuffer</title>
  1189. <para>The most common type of framebuffer is a linear array memory that
  1190. maps to the video memory on the graphics device. However, accessing
  1191. that video memory over an I/O bus (e.g., ISA or PCI) can be slow. The
  1192. shadow framebuffer layer allows the developer to keep the entire
  1193. framebuffer in main memory and copy it back to video memory at regular
  1194. intervals. It also has been extended to handle planar video memory and
  1195. rotated framebuffers.
  1196. </para>
  1197. <para>There are two main entry points to the shadow framebuffer code:
  1198. <variablelist>
  1199. <varlistentry>
  1200. <term>shadowAlloc(width, height, bpp)</term>
  1201. <listitem>
  1202. <para>This function allocates the in
  1203. memory copy of the framebuffer of size width*height*bpp. It returns a
  1204. pointer to that memory, which will be used by the framebuffer
  1205. ScreenInit() code during the screen's initialization.
  1206. </para></listitem></varlistentry>
  1207. <varlistentry>
  1208. <term>shadowInit(pScreen, updateProc, windowProc)</term>
  1209. <listitem>
  1210. <para>This function
  1211. initializes the shadow framebuffer layer. It wraps several screen
  1212. drawing functions, and registers a block handler that will update the
  1213. screen. The updateProc is a function that will copy the damaged regions
  1214. to the screen, and the windowProc is a function that is used when the
  1215. entire linear video memory range cannot be accessed simultaneously so
  1216. that only a window into that memory is available (e.g., when using the
  1217. VGA aperture).
  1218. </para></listitem></varlistentry>
  1219. </variablelist>
  1220. </para>
  1221. <para>The shadow framebuffer code keeps track of the damaged area of each
  1222. screen by calculating the bounding box of all drawing operations that
  1223. have occurred since the last screen update. Then, when the block handler
  1224. is next called, only the damaged portion of the screen is updated.
  1225. </para>
  1226. <para>Note that since the shadow framebuffer is kept in main memory, all
  1227. drawing operations are performed by the CPU and, thus, no accelerated
  1228. hardware drawing operations are possible.
  1229. </para>
  1230. </sect3>
  1231. </sect2>
  1232. <sect2>
  1233. <title>Xinerama</title>
  1234. <para>Xinerama is an X extension that allows multiple physical screens
  1235. controlled by a single X server to appear as a single screen. Although
  1236. the extension allows clients to find the physical screen layout via
  1237. extension requests, it is completely transparent to clients at the core
  1238. X11 protocol level. The original public implementation of Xinerama came
  1239. from Digital/Compaq. XFree86 rewrote it, filling in some missing pieces
  1240. and improving both X11 core protocol compliance and performance. The
  1241. Xinerama extension will be passing through X.Org's standardization
  1242. process in the near future, and the sample implementation will be based
  1243. on this rewritten version.
  1244. </para>
  1245. <para>The current implementation of Xinerama is based primarily in the DIX
  1246. (device independent) and MI (machine independent) layers of the X
  1247. server. With few exceptions the DDX layers do not need any changes to
  1248. support Xinerama. X server extensions often do need modifications to
  1249. provide full Xinerama functionality.
  1250. </para>
  1251. <para>The following is a code-level description of how Xinerama functions.
  1252. </para>
  1253. <para>Note: Because the Xinerama extension was originally called the
  1254. PanoramiX extension, many of the Xinerama functions still have the
  1255. PanoramiX prefix.
  1256. </para>
  1257. <variablelist>
  1258. <varlistentry>
  1259. <term>PanoramiXExtensionInit()</term>
  1260. <listitem>
  1261. <para>PanoramiXExtensionInit() is a
  1262. device-independent extension function that is called at the start of
  1263. each server generation from InitExtensions(), which is called from
  1264. the X server's main() function after all output devices have been
  1265. initialized, but before any input devices have been initialized.
  1266. </para>
  1267. <para>PanoramiXNumScreens is set to the number of physical screens. If
  1268. only one physical screen is present, the extension is disabled, and
  1269. PanoramiXExtensionInit() returns without doing anything else.
  1270. </para>
  1271. <para>The Xinerama extension is registered by calling AddExtension().
  1272. </para>
  1273. <para>GC and Screen private
  1274. indexes are allocated, and both GC and Screen private areas are
  1275. allocated for each physical screen. These hold Xinerama-specific
  1276. per-GC and per-Screen data. Each screen's CreateGC and CloseScreen
  1277. functions are wrapped by XineramaCreateGC() and
  1278. XineramaCloseScreen() respectively. Some new resource classes are
  1279. created for Xinerama drawables and GCs, and resource types for
  1280. Xinerama windows, pixmaps and colormaps.
  1281. </para>
  1282. <para>A region (PanoramiXScreenRegion) is
  1283. initialized to be the union of the screen regions.
  1284. The relative positioning information for the
  1285. physical screens is taken from the ScreenRec x and y members, which
  1286. the DDX layer must initialize in InitOutput(). The bounds of the
  1287. combined screen is also calculated (PanoramiXPixWidth and
  1288. PanoramiXPixHeight).
  1289. </para>
  1290. <para>The DIX layer has a list of function pointers
  1291. (ProcVector&lsqb;&rsqb;) that
  1292. holds the entry points for the functions that process core protocol
  1293. requests. The requests that Xinerama must intercept and break up
  1294. into physical screen-specific requests are wrapped. The original
  1295. set is copied to SavedProcVector&lsqb;&rsqb;. The types of requests
  1296. intercepted are Window requests, GC requests, colormap requests,
  1297. drawing requests, and some geometry-related requests. This wrapping
  1298. allows the bulk of the protocol request processing to be handled
  1299. transparently to the DIX layer. Some operations cannot be dealt with
  1300. in this way and are handled with Xinerama-specific code within the
  1301. DIX layer.
  1302. </para>
  1303. </listitem></varlistentry>
  1304. <varlistentry>
  1305. <term>PanoramiXConsolidate()</term>
  1306. <listitem>
  1307. <para>PanoramiXConsolidate() is a
  1308. device-independent extension function that is called directly from
  1309. the X server's main() function after extensions and input/output
  1310. devices have been initialized, and before the root windows are
  1311. defined and initialized.
  1312. </para>
  1313. <para>This function finds the set of depths (PanoramiXDepths&lsqb;&rsqb;) and
  1314. visuals (PanoramiXVisuals&lsqb;&rsqb;)
  1315. common to all of the physical screens.
  1316. PanoramiXNumDepths is set to the number of common depths, and
  1317. PanoramiXNumVisuals is set to the number of common visuals.
  1318. Resources are created for the single root window and the default
  1319. colormap. Each of these resources has per-physical screen entries.
  1320. </para>
  1321. </listitem></varlistentry>
  1322. <varlistentry>
  1323. <term>PanoramiXCreateConnectionBlock()</term>
  1324. <listitem>
  1325. <para>PanoramiXConsolidate() is a
  1326. device-independent extension function that is called directly from
  1327. the X server's main() function after the per-physical screen root
  1328. windows are created. It is called instead of the standard DIX
  1329. CreateConnectionBlock() function. If this function returns FALSE,
  1330. the X server exits with a fatal error. This function will return
  1331. FALSE if no common depths were found in PanoramiXConsolidate().
  1332. With no common depths, Xinerama mode is not possible.
  1333. </para>
  1334. <para>The connection block holds the information that clients get when
  1335. they open a connection to the X server. It includes information
  1336. such as the supported pixmap formats, number of screens and the
  1337. sizes, depths, visuals, default colormap information, etc, for each
  1338. of the screens (much of information that <command>xdpyinfo</command> shows). The
  1339. connection block is initialized with the combined single screen
  1340. values that were calculated in the above two functions.
  1341. </para>
  1342. <para>The Xinerama extension allows the registration of connection
  1343. block callback functions. The purpose of these is to allow other
  1344. extensions to do processing at this point. These callbacks can be
  1345. registered by calling XineramaRegisterConnectionBlockCallback() from
  1346. the other extension's ExtensionInit() function. Each registered
  1347. connection block callback is called at the end of
  1348. PanoramiXCreateConnectionBlock().
  1349. </para>
  1350. </listitem></varlistentry>
  1351. </variablelist>
  1352. <sect3>
  1353. <title>Xinerama-specific changes to the DIX code</title>
  1354. <para>There are a few types of Xinerama-specific changes within the DIX
  1355. code. The main ones are described here.
  1356. </para>
  1357. <para>Functions that deal with colormap or GC -related operations outside of
  1358. the intercepted protocol requests have a test added to only do the
  1359. processing for screen numbers &gt; 0. This is because they are handled for
  1360. the single Xinerama screen and the processing is done once for screen 0.
  1361. </para>
  1362. <para>The handling of motion events does some coordinate translation between
  1363. the physical screen's origin and screen zero's origin. Also, motion
  1364. events must be reported relative to the composite screen origin rather
  1365. than the physical screen origins.
  1366. </para>
  1367. <para>There is some special handling for cursor, window and event processing
  1368. that cannot (either not at all or not conveniently) be done via the
  1369. intercepted protocol requests. A particular case is the handling of
  1370. pointers moving between physical screens.
  1371. </para>
  1372. </sect3>
  1373. <sect3>
  1374. <title>Xinerama-specific changes to the MI code</title>
  1375. <para>The only Xinerama-specific change to the MI code is in miSendExposures()
  1376. to handle the coordinate (and window ID) translation for expose events.
  1377. </para>
  1378. </sect3>
  1379. <sect3>
  1380. <title>Intercepted DIX core requests</title>
  1381. <para>Xinerama breaks up drawing requests for dispatch to each physical
  1382. screen. It also breaks up windows into pieces for each physical screen.
  1383. GCs are translated into per-screen GCs. Colormaps are replicated on
  1384. each physical screen. The functions handling the intercepted requests
  1385. take care of breaking the requests and repackaging them so that they can
  1386. be passed to the standard request handling functions for each screen in
  1387. turn. In addition, and to aid the repackaging, the information from
  1388. many of the intercepted requests is used to keep up to date the
  1389. necessary state information for the single composite screen. Requests
  1390. (usually those with replies) that can be satisfied completely from this
  1391. stored state information do not call the standard request handling
  1392. functions.
  1393. </para>
  1394. </sect3>
  1395. </sect2>
  1396. </sect1>
  1397. <!-- ============================================================ -->
  1398. <sect1>
  1399. <title>Development Results</title>
  1400. <para>In this section the results of each phase of development are
  1401. discussed. This development took place between approximately June 2001
  1402. and July 2003.
  1403. </para>
  1404. <sect2>
  1405. <title>Phase I</title>
  1406. <para>The initial development phase dealt with the basic implementation
  1407. including the bootstrap code, which used the shadow framebuffer, and the
  1408. unoptimized implementation, based on an Xnest-style implementation.
  1409. </para>
  1410. <sect3>
  1411. <title>Scope</title>
  1412. <para>The goal of Phase I is to provide fundamental functionality that can
  1413. act as a foundation for ongoing work:
  1414. <orderedlist>
  1415. <listitem>
  1416. <para>Develop the proxy X server
  1417. <itemizedlist>
  1418. <listitem>
  1419. <para>The proxy X server will operate on the X11 protocol and
  1420. relay requests as necessary to correctly perform the request.
  1421. </para></listitem>
  1422. <listitem>
  1423. <para>Work will be based on the existing work for Xinerama and
  1424. Xnest.
  1425. </para></listitem>
  1426. <listitem>
  1427. <para>Input events and windowing operations are handled in the
  1428. proxy server and rendering requests are repackaged and sent to
  1429. each of the back-end servers for display.
  1430. </para></listitem>
  1431. <listitem>
  1432. <para>The multiple screen layout (including support for
  1433. overlapping screens) will be user configurable via a
  1434. configuration file or through the configuration tool.
  1435. </para></listitem>
  1436. </itemizedlist>
  1437. </para></listitem>
  1438. <listitem>
  1439. <para>Develop graphical configuration tool
  1440. <itemizedlist>
  1441. <listitem>
  1442. <para>There will be potentially a large number of X servers to
  1443. configure into a single display. The tool will allow the user
  1444. to specify which servers are involved in the configuration and
  1445. how they should be laid out.
  1446. </para></listitem>
  1447. </itemizedlist>
  1448. </para></listitem>
  1449. <listitem>
  1450. <para>Pass the X Test Suite
  1451. <itemizedlist>
  1452. <listitem>
  1453. <para>The X Test Suite covers the basic X11 operations. All
  1454. tests known to succeed must correctly operate in the distributed
  1455. X environment.
  1456. </para></listitem>
  1457. </itemizedlist>
  1458. </para></listitem>
  1459. </orderedlist>
  1460. </para>
  1461. <para>For this phase, the back-end X servers are assumed to be unmodified X
  1462. servers that do not support any DMX-related protocol extensions; future
  1463. optimization pathways are considered, but are not implemented; and the
  1464. configuration tool is assumed to rely only on libraries in the X source
  1465. tree (e.g., Xt).
  1466. </para>
  1467. </sect3>
  1468. <sect3>
  1469. <title>Results</title>
  1470. <para>The proxy X server, Xdmx, was developed to distribute X11 protocol
  1471. requests to the set of back-end X servers. It opens a window on each
  1472. back-end server, which represents the part of the front-end's root
  1473. window that is visible on that screen. It mirrors window, pixmap and
  1474. other state in each back-end server. Drawing requests are sent to
  1475. either windows or pixmaps on each back-end server. This code is based
  1476. on Xnest and uses the existing Xinerama extension.
  1477. </para>
  1478. <para>Input events can be taken from (1) devices attached to the back-end
  1479. server, (2) core devices attached directly to the Xdmx server, or (3)
  1480. from a ``console'' window on another X server. Events for these devices
  1481. are gathered, processed and delivered to clients attached to the Xdmx
  1482. server.
  1483. </para>
  1484. <para>An intuitive configuration format was developed to help the user
  1485. easily configure the multiple back-end X servers. It was defined (see
  1486. grammar in Xdmx man page) and a parser was implemented that is used by
  1487. the Xdmx server and by a standalone xdmxconfig utility. The parsing
  1488. support was implemented such that it can be easily factored out of the X
  1489. source tree for use with other tools (e.g., vdl). Support for
  1490. converting legacy vdl-format configuration files to the DMX format is
  1491. provided by the vdltodmx utility.
  1492. </para>
  1493. <para>Originally, the configuration file was going to be a subsection of
  1494. XFree86's XF86Config file, but that was not possible since Xdmx is a
  1495. completely separate X server. Thus, a separate config file format was
  1496. developed. In addition, a graphical configuration
  1497. tool, xdmxconfig, was developed to allow the user to create and arrange
  1498. the screens in the configuration file. The <emphasis remap="bf">-configfile</emphasis> and <emphasis remap="bf">-config</emphasis>
  1499. command-line options can be used to start Xdmx using a configuration
  1500. file.
  1501. </para>
  1502. <para>An extension that enables remote input testing is required for the X
  1503. Test Suite to function. During this phase, this extension (XTEST) was
  1504. implemented in the Xdmx server. The results from running the X Test
  1505. Suite are described in detail below.
  1506. </para>
  1507. </sect3>
  1508. <sect3>
  1509. <title>X Test Suite</title>
  1510. <sect4>
  1511. <title>Introduction</title>
  1512. <para>
  1513. The X Test Suite contains tests that verify Xlib functions
  1514. operate correctly. The test suite is designed to run on a
  1515. single X server; however, since X applications will not be
  1516. able to tell the difference between the DMX server and a
  1517. standard X server, the X Test Suite should also run on the
  1518. DMX server.
  1519. </para>
  1520. <para>
  1521. The Xdmx server was tested with the X Test Suite, and the
  1522. existing failures are noted in this section. To put these
  1523. results in perspective, we first discuss expected X Test
  1524. failures and how errors in underlying systems can impact
  1525. Xdmx test results.
  1526. </para>
  1527. </sect4>
  1528. <sect4>
  1529. <title>Expected Failures for a Single Head</title>
  1530. <para>
  1531. A correctly implemented X server with a single screen is
  1532. expected to fail certain X Test tests. The following
  1533. well-known errors occur because of rounding error in the X
  1534. server code:
  1535. <literallayout>
  1536. XDrawArc: Tests 42, 63, 66, 73
  1537. XDrawArcs: Tests 45, 66, 69, 76
  1538. </literallayout>
  1539. </para>
  1540. <para>
  1541. The following failures occur because of the high-level X
  1542. server implementation:
  1543. <literallayout>
  1544. XLoadQueryFont: Test 1
  1545. XListFontsWithInfo: Tests 3, 4
  1546. XQueryFont: Tests 1, 2
  1547. </literallayout>
  1548. </para>
  1549. <para>
  1550. The following test fails when running the X server as root
  1551. under Linux because of the way directory modes are
  1552. interpreted:
  1553. <literallayout>
  1554. XWriteBitmapFile: Test 3
  1555. </literallayout>
  1556. </para>
  1557. <para>
  1558. Depending on the video card used for the back-end, other
  1559. failures may also occur because of bugs in the low-level
  1560. driver implementation. Over time, failures of this kind
  1561. are usually fixed by XFree86, but will show up in Xdmx
  1562. testing until then.
  1563. </para>
  1564. </sect4>
  1565. <sect4>
  1566. <title>Expected Failures for Xinerama</title>
  1567. <para>
  1568. Xinerama fails several X Test Suite tests because of
  1569. design decisions made for the current implementation of
  1570. Xinerama. Over time, many of these errors will be
  1571. corrected by XFree86 and the group working on a new
  1572. Xinerama implementation. Therefore, Xdmx will also share
  1573. X Suite Test failures with Xinerama.
  1574. </para>
  1575. <para>
  1576. We may be able to fix or work-around some of these
  1577. failures at the Xdmx level, but this will require
  1578. additional exploration that was not part of Phase I.
  1579. </para>
  1580. <para>
  1581. Xinerama is constantly improving, and the list of
  1582. Xinerama-related failures depends on XFree86 version and
  1583. the underlying graphics hardware. We tested with a
  1584. variety of hardware, including nVidia, S3, ATI Radeon,
  1585. and Matrox G400 (in dual-head mode). The list below
  1586. includes only those failures that appear to be from the
  1587. Xinerama layer, and does not include failures listed in
  1588. the previous section, or failures that appear to be from
  1589. the low-level graphics driver itself:
  1590. </para>
  1591. <para>
  1592. These failures were noted with multiple Xinerama
  1593. configurations:
  1594. <literallayout>
  1595. XCopyPlane: Tests 13, 22, 31 (well-known Xinerama implementation issue)
  1596. XSetFontPath: Test 4
  1597. XGetDefault: Test 5
  1598. XMatchVisualInfo: Test 1
  1599. </literallayout>
  1600. </para>
  1601. <para>
  1602. These failures were noted only when using one dual-head
  1603. video card with a 4.2.99.x XFree86 server:
  1604. <literallayout>
  1605. XListPixmapFormats: Test 1
  1606. XDrawRectangles: Test 45
  1607. </literallayout>
  1608. </para>
  1609. <para>
  1610. These failures were noted only when using two video cards
  1611. from different vendors with a 4.1.99.x XFree86 server:
  1612. <literallayout>
  1613. XChangeWindowAttributes: Test 32
  1614. XCreateWindow: Test 30
  1615. XDrawLine: Test 22
  1616. XFillArc: Test 22
  1617. XChangeKeyboardControl: Tests 9, 10
  1618. XRebindKeysym: Test 1
  1619. </literallayout>
  1620. </para>
  1621. </sect4>
  1622. <sect4>
  1623. <title>Additional Failures from Xdmx</title>
  1624. <para>
  1625. When running Xdmx, no unexpected failures were noted.
  1626. Since the Xdmx server is based on Xinerama, we expect to
  1627. have most of the Xinerama failures present in the Xdmx
  1628. server. Similarly, since the Xdmx server must rely on the
  1629. low-level device drivers on each back-end server, we also
  1630. expect that Xdmx will exhibit most of the back-end
  1631. failures. Here is a summary:
  1632. <literallayout>
  1633. XListPixmapFormats: Test 1 (configuration dependent)
  1634. XChangeWindowAttributes: Test 32
  1635. XCreateWindow: Test 30
  1636. XCopyPlane: Test 13, 22, 31
  1637. XSetFontPath: Test 4
  1638. XGetDefault: Test 5 (configuration dependent)
  1639. XMatchVisualInfo: Test 1
  1640. XRebindKeysym: Test 1 (configuration dependent)
  1641. </literallayout>
  1642. </para>
  1643. <para>
  1644. Note that this list is shorter than the combined list for
  1645. Xinerama because Xdmx uses different code paths to perform
  1646. some Xinerama operations. Further, some Xinerama failures
  1647. have been fixed in the XFree86 4.2.99.x CVS repository.
  1648. </para>
  1649. </sect4>
  1650. <sect4>
  1651. <title>Summary and Future Work</title>
  1652. <para>
  1653. Running the X Test Suite on Xdmx does not produce any
  1654. failures that cannot be accounted for by the underlying
  1655. Xinerama subsystem used by the front-end or by the
  1656. low-level device-driver code running on the back-end X
  1657. servers. The Xdmx server therefore is as ``correct'' as
  1658. possible with respect to the standard set of X Test Suite
  1659. tests.
  1660. </para>
  1661. <para>
  1662. During the following phases, we will continue to verify
  1663. Xdmx correctness using the X Test Suite. We may also use
  1664. other tests suites or write additional tests that run
  1665. under the X Test Suite that specifically verify the
  1666. expected behavior of DMX.
  1667. </para>
  1668. </sect4>
  1669. </sect3>
  1670. <sect3>
  1671. <title>Fonts</title>
  1672. <para>In Phase I, fonts are handled directly by both the front-end and the
  1673. back-end servers, which is required since we must treat each back-end
  1674. server during this phase as a ``black box''. What this requires is that
  1675. <emphasis remap="bf">the front- and back-end servers must share the exact same font
  1676. path</emphasis>. There are two ways to help make sure that all servers share the
  1677. same font path:
  1678. <orderedlist>
  1679. <listitem>
  1680. <para>First, each server can be configured to use the same font
  1681. server. The font server, xfs, can be configured to serve fonts to
  1682. multiple X servers via TCP.
  1683. </para></listitem>
  1684. <listitem>
  1685. <para>Second, each server can be configured to use the same font
  1686. path and either those font paths can be copied to each back-end
  1687. machine or they can be mounted (e.g., via NFS) on each back-end
  1688. machine.
  1689. </para></listitem>
  1690. </orderedlist>
  1691. </para>
  1692. <para>One additional concern is that a client program can set its own font
  1693. path, and if it does so, then that font path must be available on each
  1694. back-end machine.
  1695. </para>
  1696. <para>The -fontpath command line option was added to allow users to
  1697. initialize the font path of the front end server. This font path is
  1698. propagated to each back-end server when the default font is loaded. If
  1699. there are any problems, an error message is printed, which will describe
  1700. the problem and list the current font path. For more information about
  1701. setting the font path, see the -fontpath option description in the man
  1702. page.
  1703. </para>
  1704. </sect3>
  1705. <sect3>
  1706. <title>Performance</title>
  1707. <para>Phase I of development was not intended to optimize performance. Its
  1708. focus was on completely and correctly handling the base X11 protocol in
  1709. the Xdmx server. However, several insights were gained during Phase I,
  1710. which are listed here for reference during the next phase of
  1711. development.
  1712. </para>
  1713. <orderedlist>
  1714. <listitem>
  1715. <para>Calls to XSync() can slow down rendering since it requires a
  1716. complete round trip to and from a back-end server. This is
  1717. especially problematic when communicating over long haul networks.
  1718. </para></listitem>
  1719. <listitem>
  1720. <para>Sending drawing requests to only the screens that they overlap
  1721. should improve performance.
  1722. </para></listitem>
  1723. </orderedlist>
  1724. </sect3>
  1725. <sect3>
  1726. <title>Pixmaps</title>
  1727. <para>Pixmaps were originally expected to be handled entirely in the
  1728. front-end X server; however, it was found that this overly complicated
  1729. the rendering code and would have required sending potentially large
  1730. images to each back server that required them when copying from pixmap
  1731. to screen. Thus, pixmap state is mirrored in the back-end server just
  1732. as it is with regular window state. With this implementation, the same
  1733. rendering code that draws to windows can be used to draw to pixmaps on
  1734. the back-end server, and no large image transfers are required to copy
  1735. from pixmap to window.
  1736. </para>
  1737. </sect3>
  1738. </sect2>
  1739. <!-- ============================================================ -->
  1740. <sect2>
  1741. <title>Phase II</title>
  1742. <para>The second phase of development concentrates on performance
  1743. optimizations. These optimizations are documented here, with
  1744. <command>x11perf</command> data to show how the optimizations improve performance.
  1745. </para>
  1746. <para>All benchmarks were performed by running Xdmx on a dual processor
  1747. 1.4GHz AMD Athlon machine with 1GB of RAM connecting over 100baseT to
  1748. two single-processor 1GHz Pentium III machines with 256MB of RAM and ATI
  1749. Rage 128 (RF) video cards. The front end was running Linux
  1750. 2.4.20-pre1-ac1 and the back ends were running Linux 2.4.7-10 and
  1751. version 4.2.99.1 of XFree86 pulled from the XFree86 CVS repository on
  1752. August 7, 2002. All systems were running Red Hat Linux 7.2.
  1753. </para>
  1754. <sect3>
  1755. <title>Moving from XFree86 4.1.99.1 to 4.2.0.0</title>
  1756. <para>For phase II, the working source tree was moved to the branch tagged
  1757. with dmx-1-0-branch and was updated from version 4.1.99.1 (20 August
  1758. 2001) of the XFree86 sources to version 4.2.0.0 (18 January 2002).
  1759. After this update, the following tests were noted to be more than 10%
  1760. faster:
  1761. <screen>
  1762. 1.13 Fill 300x300 opaque stippled trapezoid (161x145 stipple)
  1763. 1.16 Fill 1x1 tiled trapezoid (161x145 tile)
  1764. 1.13 Fill 10x10 tiled trapezoid (161x145 tile)
  1765. 1.17 Fill 100x100 tiled trapezoid (161x145 tile)
  1766. 1.16 Fill 1x1 tiled trapezoid (216x208 tile)
  1767. 1.20 Fill 10x10 tiled trapezoid (216x208 tile)
  1768. 1.15 Fill 100x100 tiled trapezoid (216x208 tile)
  1769. 1.37 Circulate Unmapped window (200 kids)
  1770. </screen>
  1771. And the following tests were noted to be more than 10% slower:
  1772. <screen>
  1773. 0.88 Unmap window via parent (25 kids)
  1774. 0.75 Circulate Unmapped window (4 kids)
  1775. 0.79 Circulate Unmapped window (16 kids)
  1776. 0.80 Circulate Unmapped window (25 kids)
  1777. 0.82 Circulate Unmapped window (50 kids)
  1778. 0.85 Circulate Unmapped window (75 kids)
  1779. </screen>
  1780. </para>
  1781. <para>These changes were not caused by any changes in the DMX system, and
  1782. may point to changes in the XFree86 tree or to tests that have more
  1783. "jitter" than most other <command>x11perf</command> tests.
  1784. </para>
  1785. </sect3>
  1786. <sect3>
  1787. <title>Global changes</title>
  1788. <para>During the development of the Phase II DMX server, several global
  1789. changes were made. These changes were also compared with the Phase I
  1790. server. The following tests were noted to be more than 10% faster:
  1791. <screen>
  1792. 1.13 Fill 300x300 opaque stippled trapezoid (161x145 stipple)
  1793. 1.15 Fill 1x1 tiled trapezoid (161x145 tile)
  1794. 1.13 Fill 10x10 tiled trapezoid (161x145 tile)
  1795. 1.17 Fill 100x100 tiled trapezoid (161x145 tile)
  1796. 1.16 Fill 1x1 tiled trapezoid (216x208 tile)
  1797. 1.19 Fill 10x10 tiled trapezoid (216x208 tile)
  1798. 1.15 Fill 100x100 tiled trapezoid (216x208 tile)
  1799. 1.15 Circulate Unmapped window (4 kids)
  1800. </screen>
  1801. </para>
  1802. <para>The following tests were noted to be more than 10% slower:
  1803. <screen>
  1804. 0.69 Scroll 10x10 pixels
  1805. 0.68 Scroll 100x100 pixels
  1806. 0.68 Copy 10x10 from window to window
  1807. 0.68 Copy 100x100 from window to window
  1808. 0.76 Circulate Unmapped window (75 kids)
  1809. 0.83 Circulate Unmapped window (100 kids)
  1810. </screen>
  1811. </para>
  1812. <para>For the remainder of this analysis, the baseline of comparison will
  1813. be the Phase II deliverable with all optimizations disabled (unless
  1814. otherwise noted). This will highlight how the optimizations in
  1815. isolation impact performance.
  1816. </para>
  1817. </sect3>
  1818. <sect3>
  1819. <title>XSync() Batching</title>
  1820. <para>During the Phase I implementation, XSync() was called after every
  1821. protocol request made by the DMX server. This provided the DMX server
  1822. with an interactive feel, but defeated X11's protocol buffering system
  1823. and introduced round-trip wire latency into every operation. During
  1824. Phase II, DMX was changed so that protocol requests are no longer
  1825. followed by calls to XSync(). Instead, the need for an XSync() is
  1826. noted, and XSync() calls are only made every 100mS or when the DMX
  1827. server specifically needs to make a call to guarantee interactivity.
  1828. With this new system, X11 buffers protocol as much as possible during a
  1829. 100mS interval, and many unnecessary XSync() calls are avoided.
  1830. </para>
  1831. <para>Out of more than 300 <command>x11perf</command> tests, 8 tests became more than 100
  1832. times faster, with 68 more than 50X faster, 114 more than 10X faster,
  1833. and 181 more than 2X faster. See table below for summary.
  1834. </para>
  1835. <para>The following tests were noted to be more than 10% slower with
  1836. XSync() batching on:
  1837. <screen>
  1838. 0.88 500x500 tiled rectangle (161x145 tile)
  1839. 0.89 Copy 500x500 from window to window
  1840. </screen>
  1841. </para>
  1842. </sect3>
  1843. <sect3>
  1844. <title>Offscreen Optimization</title>
  1845. <para>Windows span one or more of the back-end servers' screens; however,
  1846. during Phase I development, windows were created on every back-end
  1847. server and every rendering request was sent to every window regardless
  1848. of whether or not that window was visible. With the offscreen
  1849. optimization, the DMX server tracks when a window is completely off of a
  1850. back-end server's screen and, in that case, it does not send rendering
  1851. requests to those back-end windows. This optimization saves bandwidth
  1852. between the front and back-end servers, and it reduces the number of
  1853. XSync() calls. The performance tests were run on a DMX system with only
  1854. two back-end servers. Greater performance gains will be had as the
  1855. number of back-end servers increases.
  1856. </para>
  1857. <para>Out of more than 300 <command>x11perf</command> tests, 3 tests were at least twice as
  1858. fast, and 146 tests were at least 10% faster. Two tests were more than
  1859. 10% slower with the offscreen optimization:
  1860. <screen>
  1861. 0.88 Hide/expose window via popup (4 kids)
  1862. 0.89 Resize unmapped window (75 kids)
  1863. </screen>
  1864. </para>
  1865. </sect3>
  1866. <sect3>
  1867. <title>Lazy Window Creation Optimization</title>
  1868. <para>As mentioned above, during Phase I, windows were created on every
  1869. back-end server even if they were not visible on that back-end. With
  1870. the lazy window creation optimization, the DMX server does not create
  1871. windows on a back-end server until they are either visible or they
  1872. become the parents of a visible window. This optimization builds on the
  1873. offscreen optimization (described above) and requires it to be enabled.
  1874. </para>
  1875. <para>The lazy window creation optimization works by creating the window
  1876. data structures in the front-end server when a client creates a window,
  1877. but delays creation of the window on the back-end server(s). A private
  1878. window structure in the DMX server saves the relevant window data and
  1879. tracks changes to the window's attributes and stacking order for later
  1880. use. The only times a window is created on a back-end server are (1)
  1881. when it is mapped and is at least partially overlapping the back-end
  1882. server's screen (tracked by the offscreen optimization), or (2) when the
  1883. window becomes the parent of a previously visible window. The first
  1884. case occurs when a window is mapped or when a visible window is copied,
  1885. moved or resized and now overlaps the back-end server's screen. The
  1886. second case occurs when starting a window manager after having created
  1887. windows to which the window manager needs to add decorations.
  1888. </para>
  1889. <para>When either case occurs, a window on the back-end server is created
  1890. using the data saved in the DMX server's window private data structure.
  1891. The stacking order is then adjusted to correctly place the window on the
  1892. back-end and lastly the window is mapped. From this time forward, the
  1893. window is handled exactly as if the window had been created at the time
  1894. of the client's request.
  1895. </para>
  1896. <para>Note that when a window is no longer visible on a back-end server's
  1897. screen (e.g., it is moved offscreen), the window is not destroyed;
  1898. rather, it is kept and reused later if the window once again becomes
  1899. visible on the back-end server's screen. Originally with this
  1900. optimization, destroying windows was implemented but was later rejected
  1901. because it increased bandwidth when windows were opaquely moved or
  1902. resized, which is common in many window managers.
  1903. </para>
  1904. <para>The performance tests were run on a DMX system with only two back-end
  1905. servers. Greater performance gains will be had as the number of
  1906. back-end servers increases.
  1907. </para>
  1908. <para>This optimization improved the following <command>x11perf</command> tests by more
  1909. than 10%:
  1910. <screen>
  1911. 1.10 500x500 rectangle outline
  1912. 1.12 Fill 100x100 stippled trapezoid (161x145 stipple)
  1913. 1.20 Circulate Unmapped window (50 kids)
  1914. 1.19 Circulate Unmapped window (75 kids)
  1915. </screen>
  1916. </para>
  1917. </sect3>
  1918. <sect3>
  1919. <title>Subdividing Rendering Primitives</title>
  1920. <para>X11 imaging requests transfer significant data between the client and
  1921. the X server. During Phase I, the DMX server would then transfer the
  1922. image data to each back-end server. Even with the offscreen
  1923. optimization (above), these requests still required transferring
  1924. significant data to each back-end server that contained a visible
  1925. portion of the window. For example, if the client uses XPutImage() to
  1926. copy an image to a window that overlaps the entire DMX screen, then the
  1927. entire image is copied by the DMX server to every back-end server.
  1928. </para>
  1929. <para>To reduce the amount of data transferred between the DMX server and
  1930. the back-end servers when XPutImage() is called, the image data is
  1931. subdivided and only the data that will be visible on a back-end server's
  1932. screen is sent to that back-end server. Xinerama already implements a
  1933. subdivision algorithm for XGetImage() and no further optimization was
  1934. needed.
  1935. </para>
  1936. <para>Other rendering primitives were analyzed, but the time required to
  1937. subdivide these primitives was a significant proportion of the time
  1938. required to send the entire rendering request to the back-end server, so
  1939. this optimization was rejected for the other rendering primitives.
  1940. </para>
  1941. <para>Again, the performance tests were run on a DMX system with only two
  1942. back-end servers. Greater performance gains will be had as the number
  1943. of back-end servers increases.
  1944. </para>
  1945. <para>This optimization improved the following <command>x11perf</command> tests by more
  1946. than 10%:
  1947. <screen>
  1948. 1.12 Fill 100x100 stippled trapezoid (161x145 stipple)
  1949. 1.26 PutImage 10x10 square
  1950. 1.83 PutImage 100x100 square
  1951. 1.91 PutImage 500x500 square
  1952. 1.40 PutImage XY 10x10 square
  1953. 1.48 PutImage XY 100x100 square
  1954. 1.50 PutImage XY 500x500 square
  1955. 1.45 Circulate Unmapped window (75 kids)
  1956. 1.74 Circulate Unmapped window (100 kids)
  1957. </screen>
  1958. </para>
  1959. <para>The following test was noted to be more than 10% slower with this
  1960. optimization:
  1961. <screen>
  1962. 0.88 10-pixel fill chord partial circle
  1963. </screen>
  1964. </para>
  1965. </sect3>
  1966. <sect3>
  1967. <title>Summary of x11perf Data</title>
  1968. <para>With all of the optimizations on, 53 <command>x11perf</command> tests are more than
  1969. 100X faster than the unoptimized Phase II deliverable, with 69 more than
  1970. 50X faster, 73 more than 10X faster, and 199 more than twice as fast.
  1971. No tests were more than 10% slower than the unoptimized Phase II
  1972. deliverable. (Compared with the Phase I deliverable, only Circulate
  1973. Unmapped window (100 kids) was more than 10% slower than the Phase II
  1974. deliverable. As noted above, this test seems to have wider variability
  1975. than other <command>x11perf</command> tests.)
  1976. </para>
  1977. <para>The following table summarizes relative <command>x11perf</command> test changes for
  1978. all optimizations individually and collectively. Note that some of the
  1979. optimizations have a synergistic effect when used together.
  1980. <screen>
  1981. 1: XSync() batching only
  1982. 2: Off screen optimizations only
  1983. 3: Window optimizations only
  1984. 4: Subdivprims only
  1985. 5: All optimizations
  1986. 1 2 3 4 5 Operation
  1987. ------ ---- ---- ---- ------ ---------
  1988. 2.14 1.85 1.00 1.00 4.13 Dot
  1989. 1.67 1.80 1.00 1.00 3.31 1x1 rectangle
  1990. 2.38 1.43 1.00 1.00 2.44 10x10 rectangle
  1991. 1.00 1.00 0.92 0.98 1.00 100x100 rectangle
  1992. 1.00 1.00 1.00 1.00 1.00 500x500 rectangle
  1993. 1.83 1.85 1.05 1.06 3.54 1x1 stippled rectangle (8x8 stipple)
  1994. 2.43 1.43 1.00 1.00 2.41 10x10 stippled rectangle (8x8 stipple)
  1995. 0.98 1.00 1.00 1.00 1.00 100x100 stippled rectangle (8x8 stipple)
  1996. 1.00 1.00 1.00 1.00 0.98 500x500 stippled rectangle (8x8 stipple)
  1997. 1.75 1.75 1.00 1.00 3.40 1x1 opaque stippled rectangle (8x8 stipple)
  1998. 2.38 1.42 1.00 1.00 2.34 10x10 opaque stippled rectangle (8x8 stipple)
  1999. 1.00 1.00 0.97 0.97 1.00 100x100 opaque stippled rectangle (8x8 stipple)
  2000. 1.00 1.00 1.00 1.00 0.99 500x500 opaque stippled rectangle (8x8 stipple)
  2001. 1.82 1.82 1.04 1.04 3.56 1x1 tiled rectangle (4x4 tile)
  2002. 2.33 1.42 1.00 1.00 2.37 10x10 tiled rectangle (4x4 tile)
  2003. 1.00 0.92 1.00 1.00 1.00 100x100 tiled rectangle (4x4 tile)
  2004. 1.00 1.00 1.00 1.00 1.00 500x500 tiled rectangle (4x4 tile)
  2005. 1.94 1.62 1.00 1.00 3.66 1x1 stippled rectangle (17x15 stipple)
  2006. 1.74 1.28 1.00 1.00 1.73 10x10 stippled rectangle (17x15 stipple)
  2007. 1.00 1.00 1.00 0.89 0.98 100x100 stippled rectangle (17x15 stipple)
  2008. 1.00 1.00 1.00 1.00 0.98 500x500 stippled rectangle (17x15 stipple)
  2009. 1.94 1.62 1.00 1.00 3.67 1x1 opaque stippled rectangle (17x15 stipple)
  2010. 1.69 1.26 1.00 1.00 1.66 10x10 opaque stippled rectangle (17x15 stipple)
  2011. 1.00 0.95 1.00 1.00 1.00 100x100 opaque stippled rectangle (17x15 stipple)
  2012. 1.00 1.00 1.00 1.00 0.97 500x500 opaque stippled rectangle (17x15 stipple)
  2013. 1.93 1.61 0.99 0.99 3.69 1x1 tiled rectangle (17x15 tile)
  2014. 1.73 1.27 1.00 1.00 1.72 10x10 tiled rectangle (17x15 tile)
  2015. 1.00 1.00 1.00 1.00 0.98 100x100 tiled rectangle (17x15 tile)
  2016. 1.00 1.00 0.97 0.97 1.00 500x500 tiled rectangle (17x15 tile)
  2017. 1.95 1.63 1.00 1.00 3.83 1x1 stippled rectangle (161x145 stipple)
  2018. 1.80 1.30 1.00 1.00 1.83 10x10 stippled rectangle (161x145 stipple)
  2019. 0.97 1.00 1.00 1.00 1.01 100x100 stippled rectangle (161x145 stipple)
  2020. 1.00 1.00 1.00 1.00 0.98 500x500 stippled rectangle (161x145 stipple)
  2021. 1.95 1.63 1.00 1.00 3.56 1x1 opaque stippled rectangle (161x145 stipple)
  2022. 1.65 1.25 1.00 1.00 1.68 10x10 opaque stippled rectangle (161x145 stipple)
  2023. 1.00 1.00 1.00 1.00 1.01 100x100 opaque stippled rectangle (161x145...
  2024. 1.00 1.00 1.00 1.00 0.97 500x500 opaque stippled rectangle (161x145...
  2025. 1.95 1.63 0.98 0.99 3.80 1x1 tiled rectangle (161x145 tile)
  2026. 1.67 1.26 1.00 1.00 1.67 10x10 tiled rectangle (161x145 tile)
  2027. 1.13 1.14 1.14 1.14 1.14 100x100 tiled rectangle (161x145 tile)
  2028. 0.88 1.00 1.00 1.00 0.99 500x500 tiled rectangle (161x145 tile)
  2029. 1.93 1.63 1.00 1.00 3.53 1x1 tiled rectangle (216x208 tile)
  2030. 1.69 1.26 1.00 1.00 1.66 10x10 tiled rectangle (216x208 tile)
  2031. 1.00 1.00 1.00 1.00 1.00 100x100 tiled rectangle (216x208 tile)
  2032. 1.00 1.00 1.00 1.00 1.00 500x500 tiled rectangle (216x208 tile)
  2033. 1.82 1.70 1.00 1.00 3.38 1-pixel line segment
  2034. 2.07 1.56 0.90 1.00 3.31 10-pixel line segment
  2035. 1.29 1.10 1.00 1.00 1.27 100-pixel line segment
  2036. 1.05 1.06 1.03 1.03 1.09 500-pixel line segment
  2037. 1.30 1.13 1.00 1.00 1.29 100-pixel line segment (1 kid)
  2038. 1.32 1.15 1.00 1.00 1.32 100-pixel line segment (2 kids)
  2039. 1.33 1.16 1.00 1.00 1.33 100-pixel line segment (3 kids)
  2040. 1.92 1.64 1.00 1.00 3.73 10-pixel dashed segment
  2041. 1.34 1.16 1.00 1.00 1.34 100-pixel dashed segment
  2042. 1.24 1.11 0.99 0.97 1.23 100-pixel double-dashed segment
  2043. 1.72 1.77 1.00 1.00 3.25 10-pixel horizontal line segment
  2044. 1.83 1.66 1.01 1.00 3.54 100-pixel horizontal line segment
  2045. 1.86 1.30 1.00 1.00 1.84 500-pixel horizontal line segment
  2046. 2.11 1.52 1.00 0.99 3.02 10-pixel vertical line segment
  2047. 1.21 1.10 1.00 1.00 1.20 100-pixel vertical line segment
  2048. 1.03 1.03 1.00 1.00 1.02 500-pixel vertical line segment
  2049. 4.42 1.68 1.00 1.01 4.64 10x1 wide horizontal line segment
  2050. 1.83 1.31 1.00 1.00 1.83 100x10 wide horizontal line segment
  2051. 1.07 1.00 0.96 1.00 1.07 500x50 wide horizontal line segment
  2052. 4.10 1.67 1.00 1.00 4.62 10x1 wide vertical line segment
  2053. 1.50 1.24 1.06 1.06 1.48 100x10 wide vertical line segment
  2054. 1.06 1.03 1.00 1.00 1.05 500x50 wide vertical line segment
  2055. 2.54 1.61 1.00 1.00 3.61 1-pixel line
  2056. 2.71 1.48 1.00 1.00 2.67 10-pixel line
  2057. 1.19 1.09 1.00 1.00 1.19 100-pixel line
  2058. 1.04 1.02 1.00 1.00 1.03 500-pixel line
  2059. 2.68 1.51 0.98 1.00 3.17 10-pixel dashed line
  2060. 1.23 1.11 0.99 0.99 1.23 100-pixel dashed line
  2061. 1.15 1.08 1.00 1.00 1.15 100-pixel double-dashed line
  2062. 2.27 1.39 1.00 1.00 2.23 10x1 wide line
  2063. 1.20 1.09 1.00 1.00 1.20 100x10 wide line
  2064. 1.04 1.02 1.00 1.00 1.04 500x50 wide line
  2065. 1.52 1.45 1.00 1.00 1.52 100x10 wide dashed line
  2066. 1.54 1.47 1.00 1.00 1.54 100x10 wide double-dashed line
  2067. 1.97 1.30 0.96 0.95 1.95 10x10 rectangle outline
  2068. 1.44 1.27 1.00 1.00 1.43 100x100 rectangle outline
  2069. 3.22 2.16 1.10 1.09 3.61 500x500 rectangle outline
  2070. 1.95 1.34 1.00 1.00 1.90 10x10 wide rectangle outline
  2071. 1.14 1.14 1.00 1.00 1.13 100x100 wide rectangle outline
  2072. 1.00 1.00 1.00 1.00 1.00 500x500 wide rectangle outline
  2073. 1.57 1.72 1.00 1.00 3.03 1-pixel circle
  2074. 1.96 1.35 1.00 1.00 1.92 10-pixel circle
  2075. 1.21 1.07 0.86 0.97 1.20 100-pixel circle
  2076. 1.08 1.04 1.00 1.00 1.08 500-pixel circle
  2077. 1.39 1.19 1.03 1.03 1.38 100-pixel dashed circle
  2078. 1.21 1.11 1.00 1.00 1.23 100-pixel double-dashed circle
  2079. 1.59 1.28 1.00 1.00 1.58 10-pixel wide circle
  2080. 1.22 1.12 0.99 1.00 1.22 100-pixel wide circle
  2081. 1.06 1.04 1.00 1.00 1.05 500-pixel wide circle
  2082. 1.87 1.84 1.00 1.00 1.85 100-pixel wide dashed circle
  2083. 1.90 1.93 1.01 1.01 1.90 100-pixel wide double-dashed circle
  2084. 2.13 1.43 1.00 1.00 2.32 10-pixel partial circle
  2085. 1.42 1.18 1.00 1.00 1.42 100-pixel partial circle
  2086. 1.92 1.85 1.01 1.01 1.89 10-pixel wide partial circle
  2087. 1.73 1.67 1.00 1.00 1.73 100-pixel wide partial circle
  2088. 1.36 1.95 1.00 1.00 2.64 1-pixel solid circle
  2089. 2.02 1.37 1.00 1.00 2.03 10-pixel solid circle
  2090. 1.19 1.09 1.00 1.00 1.19 100-pixel solid circle
  2091. 1.02 0.99 1.00 1.00 1.01 500-pixel solid circle
  2092. 1.74 1.28 1.00 0.88 1.73 10-pixel fill chord partial circle
  2093. 1.31 1.13 1.00 1.00 1.31 100-pixel fill chord partial circle
  2094. 1.67 1.31 1.03 1.03 1.72 10-pixel fill slice partial circle
  2095. 1.30 1.13 1.00 1.00 1.28 100-pixel fill slice partial circle
  2096. 2.45 1.49 1.01 1.00 2.71 10-pixel ellipse
  2097. 1.22 1.10 1.00 1.00 1.22 100-pixel ellipse
  2098. 1.09 1.04 1.00 1.00 1.09 500-pixel ellipse
  2099. 1.90 1.28 1.00 1.00 1.89 100-pixel dashed ellipse
  2100. 1.62 1.24 0.96 0.97 1.61 100-pixel double-dashed ellipse
  2101. 2.43 1.50 1.00 1.00 2.42 10-pixel wide ellipse
  2102. 1.61 1.28 1.03 1.03 1.60 100-pixel wide ellipse
  2103. 1.08 1.05 1.00 1.00 1.08 500-pixel wide ellipse
  2104. 1.93 1.88 1.00 1.00 1.88 100-pixel wide dashed ellipse
  2105. 1.94 1.89 1.01 1.00 1.94 100-pixel wide double-dashed ellipse
  2106. 2.31 1.48 1.00 1.00 2.67 10-pixel partial ellipse
  2107. 1.38 1.17 1.00 1.00 1.38 100-pixel partial ellipse
  2108. 2.00 1.85 0.98 0.97 1.98 10-pixel wide partial ellipse
  2109. 1.89 1.86 1.00 1.00 1.89 100-pixel wide partial ellipse
  2110. 3.49 1.60 1.00 1.00 3.65 10-pixel filled ellipse
  2111. 1.67 1.26 1.00 1.00 1.67 100-pixel filled ellipse
  2112. 1.06 1.04 1.00 1.00 1.06 500-pixel filled ellipse
  2113. 2.38 1.43 1.01 1.00 2.32 10-pixel fill chord partial ellipse
  2114. 2.06 1.30 1.00 1.00 2.05 100-pixel fill chord partial ellipse
  2115. 2.27 1.41 1.00 1.00 2.27 10-pixel fill slice partial ellipse
  2116. 1.98 1.33 1.00 0.97 1.97 100-pixel fill slice partial ellipse
  2117. 57.46 1.99 1.01 1.00 114.92 Fill 1x1 equivalent triangle
  2118. 56.94 1.98 1.01 1.00 73.89 Fill 10x10 equivalent triangle
  2119. 6.07 1.75 1.00 1.00 6.07 Fill 100x100 equivalent triangle
  2120. 51.12 1.98 1.00 1.00 102.81 Fill 1x1 trapezoid
  2121. 51.42 1.82 1.01 1.00 94.89 Fill 10x10 trapezoid
  2122. 6.47 1.80 1.00 1.00 6.44 Fill 100x100 trapezoid
  2123. 1.56 1.28 1.00 0.99 1.56 Fill 300x300 trapezoid
  2124. 51.27 1.97 0.96 0.97 102.54 Fill 1x1 stippled trapezoid (8x8 stipple)
  2125. 51.73 2.00 1.02 1.02 67.92 Fill 10x10 stippled trapezoid (8x8 stipple)
  2126. 5.36 1.72 1.00 1.00 5.36 Fill 100x100 stippled trapezoid (8x8 stipple)
  2127. 1.54 1.26 1.00 1.00 1.59 Fill 300x300 stippled trapezoid (8x8 stipple)
  2128. 51.41 1.94 1.01 1.00 102.82 Fill 1x1 opaque stippled trapezoid (8x8 stipple)
  2129. 50.71 1.95 0.99 1.00 65.44 Fill 10x10 opaque stippled trapezoid (8x8...
  2130. 5.33 1.73 1.00 1.00 5.36 Fill 100x100 opaque stippled trapezoid (8x8...
  2131. 1.58 1.25 1.00 1.00 1.58 Fill 300x300 opaque stippled trapezoid (8x8...
  2132. 51.56 1.96 0.99 0.90 103.68 Fill 1x1 tiled trapezoid (4x4 tile)
  2133. 51.59 1.99 1.01 1.01 62.25 Fill 10x10 tiled trapezoid (4x4 tile)
  2134. 5.38 1.72 1.00 1.00 5.38 Fill 100x100 tiled trapezoid (4x4 tile)
  2135. 1.54 1.25 1.00 0.99 1.58 Fill 300x300 tiled trapezoid (4x4 tile)
  2136. 51.70 1.98 1.01 1.01 103.98 Fill 1x1 stippled trapezoid (17x15 stipple)
  2137. 44.86 1.97 1.00 1.00 44.86 Fill 10x10 stippled trapezoid (17x15 stipple)
  2138. 2.74 1.56 1.00 1.00 2.73 Fill 100x100 stippled trapezoid (17x15 stipple)
  2139. 1.29 1.14 1.00 1.00 1.27 Fill 300x300 stippled trapezoid (17x15 stipple)
  2140. 51.41 1.96 0.96 0.95 103.39 Fill 1x1 opaque stippled trapezoid (17x15...
  2141. 45.14 1.96 1.01 1.00 45.14 Fill 10x10 opaque stippled trapezoid (17x15...
  2142. 2.68 1.56 1.00 1.00 2.68 Fill 100x100 opaque stippled trapezoid (17x15...
  2143. 1.26 1.10 1.00 1.00 1.28 Fill 300x300 opaque stippled trapezoid (17x15...
  2144. 51.13 1.97 1.00 0.99 103.39 Fill 1x1 tiled trapezoid (17x15 tile)
  2145. 47.58 1.96 1.00 1.00 47.86 Fill 10x10 tiled trapezoid (17x15 tile)
  2146. 2.74 1.56 1.00 1.00 2.74 Fill 100x100 tiled trapezoid (17x15 tile)
  2147. 1.29 1.14 1.00 1.00 1.28 Fill 300x300 tiled trapezoid (17x15 tile)
  2148. 51.13 1.97 0.99 0.97 103.39 Fill 1x1 stippled trapezoid (161x145 stipple)
  2149. 45.14 1.97 1.00 1.00 44.29 Fill 10x10 stippled trapezoid (161x145 stipple)
  2150. 3.02 1.77 1.12 1.12 3.38 Fill 100x100 stippled trapezoid (161x145 stipple)
  2151. 1.31 1.13 1.00 1.00 1.30 Fill 300x300 stippled trapezoid (161x145 stipple)
  2152. 51.27 1.97 1.00 1.00 103.10 Fill 1x1 opaque stippled trapezoid (161x145...
  2153. 45.01 1.97 1.00 1.00 45.01 Fill 10x10 opaque stippled trapezoid (161x145...
  2154. 2.67 1.56 1.00 1.00 2.69 Fill 100x100 opaque stippled trapezoid (161x145..
  2155. 1.29 1.13 1.00 1.01 1.27 Fill 300x300 opaque stippled trapezoid (161x145..
  2156. 51.41 1.96 1.00 0.99 103.39 Fill 1x1 tiled trapezoid (161x145 tile)
  2157. 45.01 1.96 0.98 1.00 45.01 Fill 10x10 tiled trapezoid (161x145 tile)
  2158. 2.62 1.36 1.00 1.00 2.69 Fill 100x100 tiled trapezoid (161x145 tile)
  2159. 1.27 1.13 1.00 1.00 1.22 Fill 300x300 tiled trapezoid (161x145 tile)
  2160. 51.13 1.98 1.00 1.00 103.39 Fill 1x1 tiled trapezoid (216x208 tile)
  2161. 45.14 1.97 1.01 0.99 45.14 Fill 10x10 tiled trapezoid (216x208 tile)
  2162. 2.62 1.55 1.00 1.00 2.71 Fill 100x100 tiled trapezoid (216x208 tile)
  2163. 1.28 1.13 1.00 1.00 1.20 Fill 300x300 tiled trapezoid (216x208 tile)
  2164. 50.71 1.95 1.00 1.00 54.70 Fill 10x10 equivalent complex polygon
  2165. 5.51 1.71 0.96 0.98 5.47 Fill 100x100 equivalent complex polygons
  2166. 8.39 1.97 1.00 1.00 16.75 Fill 10x10 64-gon (Convex)
  2167. 8.38 1.83 1.00 1.00 8.43 Fill 100x100 64-gon (Convex)
  2168. 8.50 1.96 1.00 1.00 16.64 Fill 10x10 64-gon (Complex)
  2169. 8.26 1.83 1.00 1.00 8.35 Fill 100x100 64-gon (Complex)
  2170. 14.09 1.87 1.00 1.00 14.05 Char in 80-char line (6x13)
  2171. 11.91 1.87 1.00 1.00 11.95 Char in 70-char line (8x13)
  2172. 11.16 1.85 1.01 1.00 11.10 Char in 60-char line (9x15)
  2173. 10.09 1.78 1.00 1.00 10.09 Char16 in 40-char line (k14)
  2174. 6.15 1.75 1.00 1.00 6.31 Char16 in 23-char line (k24)
  2175. 11.92 1.90 1.03 1.03 11.88 Char in 80-char line (TR 10)
  2176. 8.18 1.78 1.00 0.99 8.17 Char in 30-char line (TR 24)
  2177. 42.83 1.44 1.01 1.00 42.11 Char in 20/40/20 line (6x13, TR 10)
  2178. 27.45 1.43 1.01 1.01 27.45 Char16 in 7/14/7 line (k14, k24)
  2179. 12.13 1.85 1.00 1.00 12.05 Char in 80-char image line (6x13)
  2180. 10.00 1.84 1.00 1.00 10.00 Char in 70-char image line (8x13)
  2181. 9.18 1.83 1.00 1.00 9.12 Char in 60-char image line (9x15)
  2182. 9.66 1.82 0.98 0.95 9.66 Char16 in 40-char image line (k14)
  2183. 5.82 1.72 1.00 1.00 5.99 Char16 in 23-char image line (k24)
  2184. 8.70 1.80 1.00 1.00 8.65 Char in 80-char image line (TR 10)
  2185. 4.67 1.66 1.00 1.00 4.67 Char in 30-char image line (TR 24)
  2186. 84.43 1.47 1.00 1.00 124.18 Scroll 10x10 pixels
  2187. 3.73 1.50 1.00 0.98 3.73 Scroll 100x100 pixels
  2188. 1.00 1.00 1.00 1.00 1.00 Scroll 500x500 pixels
  2189. 84.43 1.51 1.00 1.00 134.02 Copy 10x10 from window to window
  2190. 3.62 1.51 0.98 0.98 3.62 Copy 100x100 from window to window
  2191. 0.89 1.00 1.00 1.00 1.00 Copy 500x500 from window to window
  2192. 57.06 1.99 1.00 1.00 88.64 Copy 10x10 from pixmap to window
  2193. 2.49 2.00 1.00 1.00 2.48 Copy 100x100 from pixmap to window
  2194. 1.00 0.91 1.00 1.00 0.98 Copy 500x500 from pixmap to window
  2195. 2.04 1.01 1.00 1.00 2.03 Copy 10x10 from window to pixmap
  2196. 1.05 1.00 1.00 1.00 1.05 Copy 100x100 from window to pixmap
  2197. 1.00 1.00 0.93 1.00 1.04 Copy 500x500 from window to pixmap
  2198. 58.52 1.03 1.03 1.02 57.95 Copy 10x10 from pixmap to pixmap
  2199. 2.40 1.00 1.00 1.00 2.45 Copy 100x100 from pixmap to pixmap
  2200. 1.00 1.00 1.00 1.00 1.00 Copy 500x500 from pixmap to pixmap
  2201. 51.57 1.92 1.00 1.00 85.75 Copy 10x10 1-bit deep plane
  2202. 6.37 1.75 1.01 1.01 6.37 Copy 100x100 1-bit deep plane
  2203. 1.26 1.11 1.00 1.00 1.24 Copy 500x500 1-bit deep plane
  2204. 4.23 1.63 0.98 0.97 4.38 Copy 10x10 n-bit deep plane
  2205. 1.04 1.02 1.00 1.00 1.04 Copy 100x100 n-bit deep plane
  2206. 1.00 1.00 1.00 1.00 1.00 Copy 500x500 n-bit deep plane
  2207. 6.45 1.98 1.00 1.26 12.80 PutImage 10x10 square
  2208. 1.10 1.87 1.00 1.83 2.11 PutImage 100x100 square
  2209. 1.02 1.93 1.00 1.91 1.91 PutImage 500x500 square
  2210. 4.17 1.78 1.00 1.40 7.18 PutImage XY 10x10 square
  2211. 1.27 1.49 0.97 1.48 2.10 PutImage XY 100x100 square
  2212. 1.00 1.50 1.00 1.50 1.52 PutImage XY 500x500 square
  2213. 1.07 1.01 1.00 1.00 1.06 GetImage 10x10 square
  2214. 1.01 1.00 1.00 1.00 1.01 GetImage 100x100 square
  2215. 1.00 1.00 1.00 1.00 1.00 GetImage 500x500 square
  2216. 1.56 1.00 0.99 0.97 1.56 GetImage XY 10x10 square
  2217. 1.02 1.00 1.00 1.00 1.02 GetImage XY 100x100 square
  2218. 1.00 1.00 1.00 1.00 1.00 GetImage XY 500x500 square
  2219. 1.00 1.00 1.01 0.98 0.95 X protocol NoOperation
  2220. 1.02 1.03 1.04 1.03 1.00 QueryPointer
  2221. 1.03 1.02 1.04 1.03 1.00 GetProperty
  2222. 100.41 1.51 1.00 1.00 198.76 Change graphics context
  2223. 45.81 1.00 0.99 0.97 57.10 Create and map subwindows (4 kids)
  2224. 78.45 1.01 1.02 1.02 63.07 Create and map subwindows (16 kids)
  2225. 73.91 1.01 1.00 1.00 56.37 Create and map subwindows (25 kids)
  2226. 73.22 1.00 1.00 1.00 49.07 Create and map subwindows (50 kids)
  2227. 72.36 1.01 0.99 1.00 32.14 Create and map subwindows (75 kids)
  2228. 70.34 1.00 1.00 1.00 30.12 Create and map subwindows (100 kids)
  2229. 55.00 1.00 1.00 0.99 23.75 Create and map subwindows (200 kids)
  2230. 55.30 1.01 1.00 1.00 141.03 Create unmapped window (4 kids)
  2231. 55.38 1.01 1.01 1.00 163.25 Create unmapped window (16 kids)
  2232. 54.75 0.96 1.00 0.99 166.95 Create unmapped window (25 kids)
  2233. 54.83 1.00 1.00 0.99 178.81 Create unmapped window (50 kids)
  2234. 55.38 1.01 1.01 1.00 181.20 Create unmapped window (75 kids)
  2235. 55.38 1.01 1.01 1.00 181.20 Create unmapped window (100 kids)
  2236. 54.87 1.01 1.01 1.00 182.05 Create unmapped window (200 kids)
  2237. 28.13 1.00 1.00 1.00 30.75 Map window via parent (4 kids)
  2238. 36.14 1.01 1.01 1.01 32.58 Map window via parent (16 kids)
  2239. 26.13 1.00 0.98 0.95 29.85 Map window via parent (25 kids)
  2240. 40.07 1.00 1.01 1.00 27.57 Map window via parent (50 kids)
  2241. 23.26 0.99 1.00 1.00 18.23 Map window via parent (75 kids)
  2242. 22.91 0.99 1.00 0.99 16.52 Map window via parent (100 kids)
  2243. 27.79 1.00 1.00 0.99 12.50 Map window via parent (200 kids)
  2244. 22.35 1.00 1.00 1.00 56.19 Unmap window via parent (4 kids)
  2245. 9.57 1.00 0.99 1.00 89.78 Unmap window via parent (16 kids)
  2246. 80.77 1.01 1.00 1.00 103.85 Unmap window via parent (25 kids)
  2247. 96.34 1.00 1.00 1.00 116.06 Unmap window via parent (50 kids)
  2248. 99.72 1.00 1.00 1.00 124.93 Unmap window via parent (75 kids)
  2249. 112.36 1.00 1.00 1.00 125.27 Unmap window via parent (100 kids)
  2250. 105.41 1.00 1.00 0.99 120.00 Unmap window via parent (200 kids)
  2251. 51.29 1.03 1.02 1.02 74.19 Destroy window via parent (4 kids)
  2252. 86.75 0.99 0.99 0.99 116.87 Destroy window via parent (16 kids)
  2253. 106.43 1.01 1.01 1.01 127.49 Destroy window via parent (25 kids)
  2254. 120.34 1.01 1.01 1.00 140.11 Destroy window via parent (50 kids)
  2255. 126.67 1.00 0.99 0.99 145.00 Destroy window via parent (75 kids)
  2256. 126.11 1.01 1.01 1.00 140.56 Destroy window via parent (100 kids)
  2257. 128.57 1.01 1.00 1.00 137.91 Destroy window via parent (200 kids)
  2258. 16.04 0.88 1.00 1.00 20.36 Hide/expose window via popup (4 kids)
  2259. 19.04 1.01 1.00 1.00 23.48 Hide/expose window via popup (16 kids)
  2260. 19.22 1.00 1.00 1.00 20.44 Hide/expose window via popup (25 kids)
  2261. 17.41 1.00 0.91 0.97 17.68 Hide/expose window via popup (50 kids)
  2262. 17.29 1.01 1.00 1.01 17.07 Hide/expose window via popup (75 kids)
  2263. 16.74 1.00 1.00 1.00 16.17 Hide/expose window via popup (100 kids)
  2264. 10.30 1.00 1.00 1.00 10.51 Hide/expose window via popup (200 kids)
  2265. 16.48 1.01 1.00 1.00 26.05 Move window (4 kids)
  2266. 17.01 0.95 1.00 1.00 23.97 Move window (16 kids)
  2267. 16.95 1.00 1.00 1.00 22.90 Move window (25 kids)
  2268. 16.05 1.01 1.00 1.00 21.32 Move window (50 kids)
  2269. 15.58 1.00 0.98 0.98 19.44 Move window (75 kids)
  2270. 14.98 1.02 1.03 1.03 18.17 Move window (100 kids)
  2271. 10.90 1.01 1.01 1.00 12.68 Move window (200 kids)
  2272. 49.42 1.00 1.00 1.00 198.27 Moved unmapped window (4 kids)
  2273. 50.72 0.97 1.00 1.00 193.66 Moved unmapped window (16 kids)
  2274. 50.87 1.00 0.99 1.00 195.09 Moved unmapped window (25 kids)
  2275. 50.72 1.00 1.00 1.00 189.34 Moved unmapped window (50 kids)
  2276. 50.87 1.00 1.00 1.00 191.33 Moved unmapped window (75 kids)
  2277. 50.87 1.00 1.00 0.90 186.71 Moved unmapped window (100 kids)
  2278. 50.87 1.00 1.00 1.00 179.19 Moved unmapped window (200 kids)
  2279. 41.04 1.00 1.00 1.00 56.61 Move window via parent (4 kids)
  2280. 69.81 1.00 1.00 1.00 130.82 Move window via parent (16 kids)
  2281. 95.81 1.00 1.00 1.00 141.92 Move window via parent (25 kids)
  2282. 95.98 1.00 1.00 1.00 149.43 Move window via parent (50 kids)
  2283. 96.59 1.01 1.01 1.00 153.98 Move window via parent (75 kids)
  2284. 97.19 1.00 1.00 1.00 157.30 Move window via parent (100 kids)
  2285. 96.67 1.00 0.99 0.96 159.44 Move window via parent (200 kids)
  2286. 17.75 1.01 1.00 1.00 27.61 Resize window (4 kids)
  2287. 17.94 1.00 1.00 0.99 25.42 Resize window (16 kids)
  2288. 17.92 1.01 1.00 1.00 24.47 Resize window (25 kids)
  2289. 17.24 0.97 1.00 1.00 24.14 Resize window (50 kids)
  2290. 16.81 1.00 1.00 0.99 22.75 Resize window (75 kids)
  2291. 16.08 1.00 1.00 1.00 21.20 Resize window (100 kids)
  2292. 12.92 1.00 0.99 1.00 16.26 Resize window (200 kids)
  2293. 52.94 1.01 1.00 1.00 327.12 Resize unmapped window (4 kids)
  2294. 53.60 1.01 1.01 1.01 333.71 Resize unmapped window (16 kids)
  2295. 52.99 1.00 1.00 1.00 337.29 Resize unmapped window (25 kids)
  2296. 51.98 1.00 1.00 1.00 329.38 Resize unmapped window (50 kids)
  2297. 53.05 0.89 1.00 1.00 322.60 Resize unmapped window (75 kids)
  2298. 53.05 1.00 1.00 1.00 318.08 Resize unmapped window (100 kids)
  2299. 53.11 1.00 1.00 0.99 306.21 Resize unmapped window (200 kids)
  2300. 16.76 1.00 0.96 1.00 19.46 Circulate window (4 kids)
  2301. 17.24 1.00 1.00 0.97 16.24 Circulate window (16 kids)
  2302. 16.30 1.03 1.03 1.03 15.85 Circulate window (25 kids)
  2303. 13.45 1.00 1.00 1.00 14.90 Circulate window (50 kids)
  2304. 12.91 1.00 1.00 1.00 13.06 Circulate window (75 kids)
  2305. 11.30 0.98 1.00 1.00 11.03 Circulate window (100 kids)
  2306. 7.58 1.01 1.01 0.99 7.47 Circulate window (200 kids)
  2307. 1.01 1.01 0.98 1.00 0.95 Circulate Unmapped window (4 kids)
  2308. 1.07 1.07 1.01 1.07 1.02 Circulate Unmapped window (16 kids)
  2309. 1.04 1.09 1.06 1.05 0.97 Circulate Unmapped window (25 kids)
  2310. 1.04 1.23 1.20 1.18 1.05 Circulate Unmapped window (50 kids)
  2311. 1.18 1.53 1.19 1.45 1.24 Circulate Unmapped window (75 kids)
  2312. 1.08 1.02 1.01 1.74 1.01 Circulate Unmapped window (100 kids)
  2313. 1.01 1.12 0.98 0.91 0.97 Circulate Unmapped window (200 kids)
  2314. </screen>
  2315. </para>
  2316. </sect3>
  2317. <sect3>
  2318. <title>Profiling with OProfile</title>
  2319. <para>OProfile (available from http://oprofile.sourceforge.net/) is a
  2320. system-wide profiler for Linux systems that uses processor-level
  2321. counters to collect sampling data. OProfile can provide information
  2322. that is similar to that provided by <command>gprof</command>, but without the
  2323. necessity of recompiling the program with special instrumentation (i.e.,
  2324. OProfile can collect statistical profiling information about optimized
  2325. programs). A test harness was developed to collect OProfile data for
  2326. each <command>x11perf</command> test individually.
  2327. </para>
  2328. <para>Test runs were performed using the RETIRED_INSNS counter on the AMD
  2329. Athlon and the CPU_CLK_HALTED counter on the Intel Pentium III (with a
  2330. test configuration different from the one described above). We have
  2331. examined OProfile output and have compared it with <command>gprof</command> output.
  2332. This investigation has not produced results that yield performance
  2333. increases in <command>x11perf</command> numbers.
  2334. </para>
  2335. </sect3>
  2336. <!--
  2337. <sect3>Retired Instructions
  2338. <p>The initial tests using OProfile were done using the RETIRED_INSNS
  2339. counter with DMX running on the dual-processor AMD Athlon machine - the
  2340. same test configuration that was described above and that was used for
  2341. other tests. The RETIRED_INSNS counter counts retired instructions and
  2342. showed drawing, text, copying, and image tests to be dominated (&gt;
  2343. 30%) by calls to Hash(), SecurityLookupIDByClass(),
  2344. SecurityLookupIDByType(), and StandardReadRequestFromClient(). Some of
  2345. these tests also executed significant instructions in
  2346. WaitForSomething().
  2347. <p>In contrast, the window tests executed significant
  2348. instructions in SecurityLookupIDByType(), Hash(),
  2349. StandardReadRequestFromClient(), but also executed significant
  2350. instructions in other routines, such as ConfigureWindow(). Some time
  2351. was spent looking at Hash() function, but optimizations in this routine
  2352. did not lead to a dramatic increase in <tt/x11perf/ performance.
  2353. -->
  2354. <!--
  2355. <sect3>Clock Cycles
  2356. <p>Retired instructions can be misleading because Intel/AMD instructions
  2357. execute in variable amounts of time. The OProfile tests were repeated
  2358. using the Intel CPU_CLK_HALTED counter with DMX running on the second
  2359. back-end machine. Note that this is a different test configuration that
  2360. the one described above. However, these tests show the amount of time
  2361. (as measured in CPU cycles) that are spent in each routine. Because
  2362. <tt/x11perf/ was running on the first back-end machine and because
  2363. window optimizations were on, the load on the second back-end machine
  2364. was not significant.
  2365. <p>Using CPU_CLK_HALTED, DMX showed simple drawing
  2366. tests spending more than 10% of their time in
  2367. StandardReadRequestFromClient(), with significant time (&gt; 20% total)
  2368. spent in SecurityLookupIDByClass(), WaitForSomething(), and Dispatch().
  2369. For these tests, &lt; 5% of the time was spent in Hash(), which explains
  2370. why optimizing the Hash() routine did not impact <tt/x11perf/ results.
  2371. <p>The trapezoid, text, scrolling, copying, and image tests were
  2372. dominated by time in ProcFillPoly(), PanoramiXFillPoly(), dmxFillPolygon(),
  2373. SecurityLookupIDByClass(), SecurityLookupIDByType(), and
  2374. StandardReadRequestFromClient(). Hash() time was generally above 5% but
  2375. less than 10% of total time.
  2376. -->
  2377. <sect3>
  2378. <title>X Test Suite</title>
  2379. <para>The X Test Suite was run on the fully optimized DMX server using the
  2380. configuration described above. The following failures were noted:
  2381. <screen>
  2382. XListPixmapFormats: Test 1 [1]
  2383. XChangeWindowAttributes: Test 32 [1]
  2384. XCreateWindow: Test 30 [1]
  2385. XFreeColors: Test 4 [3]
  2386. XCopyArea: Test 13, 17, 21, 25, 30 [2]
  2387. XCopyPlane: Test 11, 15, 27, 31 [2]
  2388. XSetFontPath: Test 4 [1]
  2389. XChangeKeyboardControl: Test 9, 10 [1]
  2390. [1] Previously documented errors expected from the Xinerama
  2391. implementation (see Phase I discussion).
  2392. [2] Newly noted errors that have been verified as expected
  2393. behavior of the Xinerama implementation.
  2394. [3] Newly noted error that has been verified as a Xinerama
  2395. implementation bug.
  2396. </screen>
  2397. </para>
  2398. </sect3>
  2399. </sect2>
  2400. <!-- ============================================================ -->
  2401. <sect2>
  2402. <title>Phase III</title>
  2403. <para>During the third phase of development, support was provided for the
  2404. following extensions: SHAPE, RENDER, XKEYBOARD, XInput.
  2405. </para>
  2406. <sect3>
  2407. <title>SHAPE</title>
  2408. <para>The SHAPE extension is supported. Test applications (e.g., xeyes and
  2409. oclock) and window managers that make use of the SHAPE extension will
  2410. work as expected.
  2411. </para>
  2412. </sect3>
  2413. <sect3>
  2414. <title>RENDER</title>
  2415. <para>The RENDER extension is supported. The version included in the DMX
  2416. CVS tree is version 0.2, and this version is fully supported by Xdmx.
  2417. Applications using only version 0.2 functions will work correctly;
  2418. however, some apps that make use of functions from later versions do not
  2419. properly check the extension's major/minor version numbers. These apps
  2420. will fail with a Bad Implementation error when using post-version 0.2
  2421. functions. This is expected behavior. When the DMX CVS tree is updated
  2422. to include newer versions of RENDER, support for these newer functions
  2423. will be added to the DMX X server.
  2424. </para>
  2425. </sect3>
  2426. <sect3>
  2427. <title>XKEYBOARD</title>
  2428. <para>The XKEYBOARD extension is supported. If present on the back-end X
  2429. servers, the XKEYBOARD extension will be used to obtain information
  2430. about the type of the keyboard for initialization. Otherwise, the
  2431. keyboard will be initialized using defaults. Note that this departs
  2432. from older behavior: when Xdmx is compiled without XKEYBOARD support,
  2433. the map from the back-end X server will be preserved. With XKEYBOARD
  2434. support, the map is not preserved because better information and control
  2435. of the keyboard is available.
  2436. </para>
  2437. </sect3>
  2438. <sect3>
  2439. <title>XInput</title>
  2440. <para>The XInput extension is supported. Any device can be used as a core
  2441. device and be used as an XInput extension device, with the exception of
  2442. core devices on the back-end servers. This limitation is present
  2443. because cursor handling on the back-end requires that the back-end
  2444. cursor sometimes track the Xdmx core cursor -- behavior that is
  2445. incompatible with using the back-end pointer as a non-core device.
  2446. </para>
  2447. <para>Currently, back-end extension devices are not available as Xdmx
  2448. extension devices, but this limitation should be removed in the future.
  2449. </para>
  2450. <para>To demonstrate the XInput extension, and to provide more examples for
  2451. low-level input device driver writers, USB device drivers have been
  2452. written for mice (usb-mou), keyboards (usb-kbd), and
  2453. non-mouse/non-keyboard USB devices (usb-oth). Please see the man page
  2454. for information on Linux kernel drivers that are required for using
  2455. these Xdmx drivers.
  2456. </para>
  2457. </sect3>
  2458. <sect3>
  2459. <title>DPMS</title>
  2460. <para>The DPMS extension is exported but does not do anything at this time.
  2461. </para>
  2462. </sect3>
  2463. <sect3>
  2464. <title>Other Extensions</title>
  2465. <para>The LBX,
  2466. SECURITY,
  2467. XC-APPGROUP, and
  2468. XFree86-Bigfont
  2469. extensions do not require any special Xdmx support and have been exported.
  2470. </para>
  2471. <para>The
  2472. BIG-REQUESTS,
  2473. DEC-XTRAP,
  2474. DOUBLE-BUFFER,
  2475. Extended-Visual-Information,
  2476. FontCache,
  2477. GLX,
  2478. MIT-SCREEN-SAVER,
  2479. MIT-SHM,
  2480. MIT-SUNDRY-NONSTANDARD,
  2481. RECORD,
  2482. SECURITY,
  2483. SGI-GLX,
  2484. SYNC,
  2485. TOG-CUP,
  2486. X-Resource,
  2487. XC-MISC,
  2488. XFree86-DGA,
  2489. XFree86-DRI,
  2490. XFree86-Misc,
  2491. XFree86-VidModeExtension, and
  2492. XVideo
  2493. extensions are <emphasis remap="it">not</emphasis> supported at this time, but will be evaluated
  2494. for inclusion in future DMX releases. <emphasis remap="bf">See below for additional work
  2495. on extensions after Phase III.</emphasis>
  2496. </para>
  2497. </sect3>
  2498. </sect2>
  2499. <sect2>
  2500. <title>Phase IV</title>
  2501. <sect3>
  2502. <title>Moving to XFree86 4.3.0</title>
  2503. <para>For Phase IV, the recent release of XFree86 4.3.0 (27 February 2003)
  2504. was merged onto the dmx.sourceforge.net CVS trunk and all work is
  2505. proceeding using this tree.
  2506. </para>
  2507. </sect3>
  2508. <sect3>
  2509. <title>Extensions </title>
  2510. <sect4>
  2511. <title>XC-MISC (supported)</title>
  2512. <para>XC-MISC is used internally by the X library to recycle XIDs from the
  2513. X server. This is important for long-running X server sessions. Xdmx
  2514. supports this extension. The X Test Suite passed and failed the exact
  2515. same tests before and after this extension was enabled.
  2516. <!-- Tested February/March 2003 -->
  2517. </para>
  2518. </sect4>
  2519. <sect4>
  2520. <title>Extended-Visual-Information (supported)</title>
  2521. <para>The Extended-Visual-Information extension provides a method for an X
  2522. client to obtain detailed visual information. Xdmx supports this
  2523. extension. It was tested using the <filename>hw/dmx/examples/evi</filename> example
  2524. program. <emphasis remap="bf">Note that this extension is not Xinerama-aware</emphasis> -- it will
  2525. return visual information for each screen even though Xinerama is
  2526. causing the X server to export a single logical screen.
  2527. <!-- Tested March 2003 -->
  2528. </para>
  2529. </sect4>
  2530. <sect4>
  2531. <title>RES (supported)</title>
  2532. <para>The X-Resource extension provides a mechanism for a client to obtain
  2533. detailed information about the resources used by other clients. This
  2534. extension was tested with the <filename>hw/dmx/examples/res</filename> program. The
  2535. X Test Suite passed and failed the exact same tests before and after
  2536. this extension was enabled.
  2537. <!-- Tested March 2003 -->
  2538. </para>
  2539. </sect4>
  2540. <sect4>
  2541. <title>BIG-REQUESTS (supported)</title>
  2542. <para>This extension enables the X11 protocol to handle requests longer
  2543. than 262140 bytes. The X Test Suite passed and failed the exact same
  2544. tests before and after this extension was enabled.
  2545. <!-- Tested March 2003 -->
  2546. </para>
  2547. </sect4>
  2548. <sect4>
  2549. <title>XSYNC (supported)</title>
  2550. <para>This extension provides facilities for two different X clients to
  2551. synchronize their requests. This extension was minimally tested with
  2552. <command>xdpyinfo</command> and the X Test Suite passed and failed the exact same
  2553. tests before and after this extension was enabled.
  2554. <!-- Tested March 2003 -->
  2555. </para>
  2556. </sect4>
  2557. <sect4>
  2558. <title>XTEST, RECORD, DEC-XTRAP (supported) and XTestExtension1 (not supported)</title>
  2559. <para>The XTEST and RECORD extension were developed by the X Consortium for
  2560. use in the X Test Suite and are supported as a standard in the X11R6
  2561. tree. They are also supported in Xdmx. When X Test Suite tests that
  2562. make use of the XTEST extension are run, Xdmx passes and fails exactly
  2563. the same tests as does a standard XFree86 X server. When the
  2564. <literal remap="tt">rcrdtest</literal> test (a part of the X Test Suite that verifies the RECORD
  2565. extension) is run, Xdmx passes and fails exactly the same tests as does
  2566. a standard XFree86 X server. <!-- Tested February/March 2003 -->
  2567. </para>
  2568. <para>There are two older XTEST-like extensions: DEC-XTRAP and
  2569. XTestExtension1. The XTestExtension1 extension was developed for use by
  2570. the X Testing Consortium for use with a test suite that eventually
  2571. became (part of?) the X Test Suite. Unlike XTEST, which only allows
  2572. events to be sent to the server, the XTestExtension1 extension also
  2573. allowed events to be recorded (similar to the RECORD extension). The
  2574. second is the DEC-XTRAP extension that was developed by the Digital
  2575. Equipment Corporation.
  2576. </para>
  2577. <para>The DEC-XTRAP extension is available from Xdmx and has been tested
  2578. with the <command>xtrap*</command> tools which are distributed as standard X11R6
  2579. clients. <!-- Tested March 2003 -->
  2580. </para>
  2581. <para>The XTestExtension1 is <emphasis>not</emphasis> supported because it does not appear
  2582. to be used by any modern X clients (the few that support it also support
  2583. XTEST) and because there are no good methods available for testing that
  2584. it functions correctly (unlike XTEST and DEC-XTRAP, the code for
  2585. XTestExtension1 is not part of the standard X server source tree, so
  2586. additional testing is important). <!-- Tested March 2003 -->
  2587. </para>
  2588. <para>Most of these extensions are documented in the X11R6 source tree.
  2589. Further, several original papers exist that this author was unable to
  2590. locate -- for completeness and historical interest, citations are
  2591. provide:
  2592. <variablelist>
  2593. <varlistentry>
  2594. <term>XRECORD</term>
  2595. <listitem>
  2596. <para>Martha Zimet. Extending X For Recording. 8th Annual X
  2597. Technical Conference Boston, MA January 24-26, 1994.
  2598. </para></listitem></varlistentry>
  2599. <varlistentry>
  2600. <term>DEC-XTRAP</term>
  2601. <listitem>
  2602. <para>Dick Annicchiarico, Robert Chesler, Alan Jamison. XTrap
  2603. Architecture. Digital Equipment Corporation, July 1991.
  2604. </para></listitem></varlistentry>
  2605. <varlistentry>
  2606. <term>XTestExtension1</term>
  2607. <listitem>
  2608. <para>Larry Woestman. X11 Input Synthesis Extension
  2609. Proposal. Hewlett Packard, November 1991.
  2610. </para></listitem></varlistentry>
  2611. </variablelist>
  2612. </para>
  2613. </sect4>
  2614. <sect4>
  2615. <title>MIT-MISC (not supported)</title>
  2616. <para>The MIT-MISC extension is used to control a bug-compatibility flag
  2617. that provides compatibility with xterm programs from X11R1 and X11R2.
  2618. There does not appear to be a single client available that makes use of
  2619. this extension and there is not way to verify that it works correctly.
  2620. The Xdmx server does <emphasis>not</emphasis> support MIT-MISC.
  2621. </para>
  2622. </sect4>
  2623. <sect4>
  2624. <title>SCREENSAVER (not supported)</title>
  2625. <para>This extension provides special support for the X screen saver. It
  2626. was tested with beforelight, which appears to be the only client that
  2627. works with it. When Xinerama was not active, <command>beforelight</command> behaved
  2628. as expected. However, when Xinerama was active, <command>beforelight</command> did
  2629. not behave as expected. Further, when this extension is not active,
  2630. <command>xscreensaver</command> (a widely-used X screen saver program) did not behave
  2631. as expected. Since this extension is not Xinerama-aware and is not
  2632. commonly used with expected results by clients, we have left this
  2633. extension disabled at this time.
  2634. </para>
  2635. </sect4>
  2636. <sect4>
  2637. <title>GLX (supported)</title>
  2638. <para>The GLX extension provides OpenGL and GLX windowing support. In
  2639. Xdmx, the extension is called glxProxy, and it is Xinerama aware. It
  2640. works by either feeding requests forward through Xdmx to each of the
  2641. back-end servers or handling them locally. All rendering requests are
  2642. handled on the back-end X servers. This code was donated to the DMX
  2643. project by SGI. For the X Test Suite results comparison, see below.
  2644. </para>
  2645. </sect4>
  2646. <sect4>
  2647. <title>RENDER (supported)</title>
  2648. <para>The X Rendering Extension (RENDER) provides support for digital image
  2649. composition. Geometric and text rendering are supported. RENDER is
  2650. partially Xinerama-aware, with text and the most basic compositing
  2651. operator; however, its higher level primitives (triangles, triangle
  2652. strips, and triangle fans) are not yet Xinerama-aware. The RENDER
  2653. extension is still under development, and is currently at version 0.8.
  2654. Additional support will be required in DMX as more primitives and/or
  2655. requests are added to the extension.
  2656. </para>
  2657. <para>There is currently no test suite for the X Rendering Extension;
  2658. however, there has been discussion of developing a test suite as the
  2659. extension matures. When that test suite becomes available, additional
  2660. testing can be performed with Xdmx. The X Test Suite passed and failed
  2661. the exact same tests before and after this extension was enabled.
  2662. </para>
  2663. </sect4>
  2664. <sect4>
  2665. <title>Summary</title>
  2666. <!-- WARNING: this list is duplicated in the "Common X extension
  2667. support" section -->
  2668. <para>To summarize, the following extensions are currently supported:
  2669. BIG-REQUESTS,
  2670. DEC-XTRAP,
  2671. DMX,
  2672. DPMS,
  2673. Extended-Visual-Information,
  2674. GLX,
  2675. LBX,
  2676. RECORD,
  2677. RENDER,
  2678. SECURITY,
  2679. SHAPE,
  2680. SYNC,
  2681. X-Resource,
  2682. XC-APPGROUP,
  2683. XC-MISC,
  2684. XFree86-Bigfont,
  2685. XINERAMA,
  2686. XInputExtension,
  2687. XKEYBOARD, and
  2688. XTEST.
  2689. </para>
  2690. <para>The following extensions are <emphasis>not</emphasis> supported at this time:
  2691. DOUBLE-BUFFER,
  2692. FontCache,
  2693. MIT-SCREEN-SAVER,
  2694. MIT-SHM,
  2695. MIT-SUNDRY-NONSTANDARD,
  2696. TOG-CUP,
  2697. XFree86-DGA,
  2698. XFree86-Misc,
  2699. XFree86-VidModeExtension,
  2700. XTestExtensionExt1, and
  2701. XVideo.
  2702. </para>
  2703. </sect4>
  2704. </sect3>
  2705. <sect3>
  2706. <title>Additional Testing with the X Test Suite</title>
  2707. <sect4>
  2708. <title>XFree86 without XTEST</title>
  2709. <para>After the release of XFree86 4.3.0, we retested the XFree86 X server
  2710. with and without using the XTEST extension. When the XTEST extension
  2711. was <emphasis>not</emphasis> used for testing, the XFree86 4.3.0 server running on our
  2712. usual test system with a Radeon VE card reported unexpected failures in
  2713. the following tests:
  2714. <literallayout>
  2715. XListPixmapFormats: Test 1
  2716. XChangeKeyboardControl: Tests 9, 10
  2717. XGetDefault: Test 5
  2718. XRebindKeysym: Test 1
  2719. </literallayout>
  2720. </para>
  2721. </sect4>
  2722. <sect4>
  2723. <title>XFree86 with XTEST</title>
  2724. <para>When using the XTEST extension, the XFree86 4.3.0 server reported the
  2725. following errors:
  2726. <literallayout>
  2727. XListPixmapFormats: Test 1
  2728. XChangeKeyboardControl: Tests 9, 10
  2729. XGetDefault: Test 5
  2730. XRebindKeysym: Test 1
  2731. XAllowEvents: Tests 20, 21, 24
  2732. XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25
  2733. XGrabKey: Test 8
  2734. XSetPointerMapping: Test 3
  2735. XUngrabButton: Test 4
  2736. </literallayout>
  2737. </para>
  2738. <para>While these errors may be important, they will probably be fixed
  2739. eventually in the XFree86 source tree. We are particularly interested
  2740. in demonstrating that the Xdmx server does not introduce additional
  2741. failures that are not known Xinerama failures.
  2742. </para>
  2743. </sect4>
  2744. <sect4>
  2745. <title>Xdmx with XTEST, without Xinerama, without GLX</title>
  2746. <para>Without Xinerama, but using the XTEST extension, the following errors
  2747. were reported from Xdmx (note that these are the same as for the XFree86
  2748. 4.3.0, except that XGetDefault no longer fails):
  2749. <literallayout>
  2750. XListPixmapFormats: Test 1
  2751. XChangeKeyboardControl: Tests 9, 10
  2752. XRebindKeysym: Test 1
  2753. XAllowEvents: Tests 20, 21, 24
  2754. XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25
  2755. XGrabKey: Test 8
  2756. XSetPointerMapping: Test 3
  2757. XUngrabButton: Test 4
  2758. </literallayout>
  2759. </para>
  2760. </sect4>
  2761. <sect4>
  2762. <title>Xdmx with XTEST, with Xinerama, without GLX</title>
  2763. <para>With Xinerama, using the XTEST extension, the following errors
  2764. were reported from Xdmx:
  2765. <literallayout>
  2766. XListPixmapFormats: Test 1
  2767. XChangeKeyboardControl: Tests 9, 10
  2768. XRebindKeysym: Test 1
  2769. XAllowEvents: Tests 20, 21, 24
  2770. XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25
  2771. XGrabKey: Test 8
  2772. XSetPointerMapping: Test 3
  2773. XUngrabButton: Test 4
  2774. XCopyPlane: Tests 13, 22, 31 (well-known XTEST/Xinerama interaction issue)
  2775. XDrawLine: Test 67
  2776. XDrawLines: Test 91
  2777. XDrawSegments: Test 68
  2778. </literallayout>
  2779. Note that the first two sets of errors are the same as for the XFree86
  2780. 4.3.0 server, and that the XCopyPlane error is a well-known error
  2781. resulting from an XTEST/Xinerama interaction when the request crosses a
  2782. screen boundary. The XDraw* errors are resolved when the tests are run
  2783. individually and they do not cross a screen boundary. We will
  2784. investigate these errors further to determine their cause.
  2785. </para>
  2786. </sect4>
  2787. <sect4>
  2788. <title>Xdmx with XTEST, with Xinerama, with GLX</title>
  2789. <para>With GLX enabled, using the XTEST extension, the following errors
  2790. were reported from Xdmx (these results are from early during the Phase
  2791. IV development, but were confirmed with a late Phase IV snapshot):
  2792. <literallayout>
  2793. XListPixmapFormats: Test 1
  2794. XChangeKeyboardControl: Tests 9, 10
  2795. XRebindKeysym: Test 1
  2796. XAllowEvents: Tests 20, 21, 24
  2797. XGrabButton: Tests 5, 9-12, 14, 16, 19, 21-25
  2798. XGrabKey: Test 8
  2799. XSetPointerMapping: Test 3
  2800. XUngrabButton: Test 4
  2801. XClearArea: Test 8
  2802. XCopyArea: Tests 4, 5, 11, 14, 17, 23, 25, 27, 30
  2803. XCopyPlane: Tests 6, 7, 10, 19, 22, 31
  2804. XDrawArcs: Tests 89, 100, 102
  2805. XDrawLine: Test 67
  2806. XDrawSegments: Test 68
  2807. </literallayout>
  2808. Note that the first two sets of errors are the same as for the XFree86
  2809. 4.3.0 server, and that the third set has different failures than when
  2810. Xdmx does not include GLX support. Since the GLX extension adds new
  2811. visuals to support GLX's visual configs and the X Test Suite runs tests
  2812. over the entire set of visuals, additional rendering tests were run and
  2813. presumably more of them crossed a screen boundary. This conclusion is
  2814. supported by the fact that nearly all of the rendering errors reported
  2815. are resolved when the tests are run individually and they do no cross a
  2816. screen boundary.
  2817. </para>
  2818. <para>Further, when hardware rendering is disabled on the back-end displays,
  2819. many of the errors in the third set are eliminated, leaving only:
  2820. <literallayout>
  2821. XClearArea: Test 8
  2822. XCopyArea: Test 4, 5, 11, 14, 17, 23, 25, 27, 30
  2823. XCopyPlane: Test 6, 7, 10, 19, 22, 31
  2824. </literallayout>
  2825. </para>
  2826. </sect4>
  2827. <sect4>
  2828. <title>Conclusion</title>
  2829. <para>We conclude that all of the X Test Suite errors reported for Xdmx are
  2830. the result of errors in the back-end X server or the Xinerama
  2831. implementation. Further, all of these errors that can be reasonably
  2832. fixed at the Xdmx layer have been. (Where appropriate, we have
  2833. submitted patches to the XFree86 and Xinerama upstream maintainers.)
  2834. </para>
  2835. </sect4>
  2836. </sect3>
  2837. <sect3>
  2838. <title>Dynamic Reconfiguration</title>
  2839. <para>During this development phase, dynamic reconfiguration support was
  2840. added to DMX. This support allows an application to change the position
  2841. and offset of a back-end server's screen. For example, if the
  2842. application would like to shift a screen slightly to the left, it could
  2843. query Xdmx for the screen's &lt;x,y&gt; position and then dynamically
  2844. reconfigure that screen to be at position &lt;x+10,y&gt;. When a screen
  2845. is dynamically reconfigured, input handling and a screen's root window
  2846. dimensions are adjusted as needed. These adjustments are transparent to
  2847. the user.
  2848. </para>
  2849. <sect4>
  2850. <title>Dynamic reconfiguration extension</title>
  2851. <para>The application interface to DMX's dynamic reconfiguration is through
  2852. a function in the DMX extension library:
  2853. <programlisting>
  2854. Bool DMXReconfigureScreen(Display *dpy, int screen, int x, int y)
  2855. </programlisting>
  2856. where <parameter>dpy</parameter> is DMX server's display, <parameter>screen</parameter> is the number of the
  2857. screen to be reconfigured, and <parameter>x</parameter> and <parameter>y</parameter> are the new upper,
  2858. left-hand coordinates of the screen to be reconfigured.
  2859. </para>
  2860. <para>The coordinates are not limited other than as required by the X
  2861. protocol, which limits all coordinates to a signed 16 bit number. In
  2862. addition, all coordinates within a screen must also be legal values.
  2863. Therefore, setting a screen's upper, left-hand coordinates such that the
  2864. right or bottom edges of the screen is greater than 32,767 is illegal.
  2865. </para>
  2866. </sect4>
  2867. <sect4>
  2868. <title>Bounding box</title>
  2869. <para>When the Xdmx server is started, a bounding box is calculated from
  2870. the screens' layout given either on the command line or in the
  2871. configuration file. This bounding box is currently fixed for the
  2872. lifetime of the Xdmx server.
  2873. </para>
  2874. <para>While it is possible to move a screen outside of the bounding box, it
  2875. is currently not possible to change the dimensions of the bounding box.
  2876. For example, it is possible to specify coordinates of &lt;-100,-100&gt;
  2877. for the upper, left-hand corner of the bounding box, which was
  2878. previously at coordinates &lt;0,0&gt;. As expected, the screen is moved
  2879. down and to the right; however, since the bounding box is fixed, the
  2880. left side and upper portions of the screen exposed by the
  2881. reconfiguration are no longer accessible on that screen. Those
  2882. inaccessible regions are filled with black.
  2883. </para>
  2884. <para>This fixed bounding box limitation will be addressed in a future
  2885. development phase.
  2886. </para>
  2887. </sect4>
  2888. <sect4>
  2889. <title>Sample applications</title>
  2890. <para>An example of where this extension is useful is in setting up a video
  2891. wall. It is not always possible to get everything perfectly aligned,
  2892. and sometimes the positions are changed (e.g., someone might bump into a
  2893. projector). Instead of physically moving projectors or monitors, it is
  2894. now possible to adjust the positions of the back-end server's screens
  2895. using the dynamic reconfiguration support in DMX.
  2896. </para>
  2897. <para>Other applications, such as automatic setup and calibration tools,
  2898. can make use of dynamic reconfiguration to correct for projector
  2899. alignment problems, as long as the projectors are still arranged
  2900. rectilinearly. Horizontal and vertical keystone correction could be
  2901. applied to projectors to correct for non-rectilinear alignment problems;
  2902. however, this must be done external to Xdmx.
  2903. </para>
  2904. <para>A sample test program is included in the DMX server's examples
  2905. directory to demonstrate the interface and how an application might use
  2906. dynamic reconfiguration. See <filename>dmxreconfig.c</filename> for details.
  2907. </para>
  2908. </sect4>
  2909. <sect4>
  2910. <title>Additional notes</title>
  2911. <para>In the original development plan, Phase IV was primarily devoted to
  2912. adding OpenGL support to DMX; however, SGI became interested in the DMX
  2913. project and developed code to support OpenGL/GLX. This code was later
  2914. donated to the DMX project and integrated into the DMX code base, which
  2915. freed the DMX developers to concentrate on dynamic reconfiguration (as
  2916. described above).
  2917. </para>
  2918. </sect4>
  2919. </sect3>
  2920. <sect3>
  2921. <title>Doxygen documentation</title>
  2922. <para>Doxygen is an open-source (GPL) documentation system for generating
  2923. browseable documentation from stylized comments in the source code. We
  2924. have placed all of the Xdmx server and DMX protocol source code files
  2925. under Doxygen so that comprehensive documentation for the Xdmx source
  2926. code is available in an easily browseable format.
  2927. </para>
  2928. </sect3>
  2929. <sect3>
  2930. <title>Valgrind</title>
  2931. <para>Valgrind, an open-source (GPL) memory debugger for Linux, was used to
  2932. search for memory management errors. Several memory leaks were detected
  2933. and repaired. The following errors were not addressed:
  2934. <orderedlist>
  2935. <listitem><para>
  2936. When the X11 transport layer sends a reply to the client, only
  2937. those fields that are required by the protocol are filled in --
  2938. unused fields are left as uninitialized memory and are therefore
  2939. noted by valgrind. These instances are not errors and were not
  2940. repaired.
  2941. </para></listitem>
  2942. <listitem><para>
  2943. At each server generation, glxInitVisuals allocates memory that
  2944. is never freed. The amount of memory lost each generation
  2945. approximately equal to 128 bytes for each back-end visual.
  2946. Because the code involved is automatically generated, this bug
  2947. has not been fixed and will be referred to SGI.
  2948. </para></listitem>
  2949. <listitem><para>
  2950. At each server generation, dmxRealizeFont calls XLoadQueryFont,
  2951. which allocates a font structure that is not freed.
  2952. dmxUnrealizeFont can free the font structure for the first
  2953. screen, but cannot free it for the other screens since they are
  2954. already closed by the time dmxUnrealizeFont could free them.
  2955. The amount of memory lost each generation is approximately equal
  2956. to 80 bytes per font per back-end. When this bug is fixed in
  2957. the the X server's device-independent (dix) code, DMX will be
  2958. able to properly free the memory allocated by XLoadQueryFont.
  2959. </para></listitem>
  2960. </orderedlist>
  2961. </para>
  2962. </sect3>
  2963. <sect3>
  2964. <title>RATS</title>
  2965. <para>RATS (Rough Auditing Tool for Security) is an open-source (GPL)
  2966. security analysis tool that scans source code for common
  2967. security-related programming errors (e.g., buffer overflows and TOCTOU
  2968. races). RATS was used to audit all of the code in the hw/dmx directory
  2969. and all "High" notations were checked manually. The code was either
  2970. re-written to eliminate the warning, or a comment containing "RATS" was
  2971. inserted on the line to indicate that a human had checked the code.
  2972. Unrepaired warnings are as follows:
  2973. <orderedlist>
  2974. <listitem><para>
  2975. Fixed-size buffers are used in many areas, but code has been
  2976. added to protect against buffer overflows (e.g., snprintf).
  2977. The only instances that have not yet been fixed are in
  2978. config/xdmxconfig.c (which is not part of the Xdmx server) and
  2979. input/usb-common.c.
  2980. </para></listitem>
  2981. <listitem><para>
  2982. vprintf and vfprintf are used in the logging routines. In
  2983. general, all uses of these functions (e.g., dmxLog) provide a
  2984. constant format string from a trusted source, so the use is
  2985. relatively benign.
  2986. </para></listitem>
  2987. <listitem><para>
  2988. glxProxy/glxscreens.c uses getenv and strcat. The use of these
  2989. functions is safe and will remain safe as long as
  2990. ExtensionsString is longer then GLXServerExtensions (ensuring
  2991. this may not be ovious to the casual programmer, but this is in
  2992. automatically generated code, so we hope that the generator
  2993. enforces this constraint).
  2994. </para></listitem>
  2995. </orderedlist>
  2996. </para>
  2997. </sect3>
  2998. </sect2>
  2999. </sect1>
  3000. </appendix>
  3001. </article>
  3002. <!-- Local Variables: -->
  3003. <!-- fill-column: 72 -->
  3004. <!-- End: -->