1Adding EXA support to your X.Org video driver 2--------------------------------------------- 3EXA (for EXcellent Architecture or Ex-kaa aXeleration Architecture or 4whatever) aims to extend the life of the venerable XFree86 video drivers by 5introducing a new set of acceleration hooks that efficiently accelerate the X 6Render extension, including solid fills, blits within screen memory and to and 7from system memory, and Porter-Duff compositing and transform operations. 8 9Configuration 10------------- 11Some drivers implement a per-instance useEXA flag to track whether EXA is 12active or not. 13 14Setting the flag can be done in the driver's Options parsing routine. 15 16Loading EXA 17------------ 18EXA drivers in the XFree86 DDX should use the loadable module loader to load 19the EXA core. Careful versioning allows the EXA API to be extended without 20breaking the ABI for older versions of drivers. Example code for loading EXA: 21 22static const char *exaSymbols[] = { 23 "exaDriverAlloc", 24 "exaDriverInit", 25 "exaDriverFini", 26 "exaOffscreenAlloc", 27 "exaOffscreenFree", 28 "exaGetPixmapOffset", 29 "exaGetPixmapPitch", 30 "exaGetPixmapSize", 31 "exaMarkSync", 32 "exaWaitSync", 33 NULL 34}; 35 36 if (info->useEXA) { 37 info->exaReq.majorversion = 2; 38 info->exaReq.minorversion = 0; 39 40 if (!LoadSubModule(pScrn->module, "exa", NULL, NULL, NULL, 41 &info->exaReq, &errmaj, &errmin)) { 42 LoaderErrorMsg(NULL, "exa", errmaj, errmin); 43 return FALSE; 44 } 45 xf86LoaderReqSymLists(exaSymbols, NULL); 46 } 47 48EXA is then initialized using exaDriverAlloc and exaDriverInit. See doxygen 49documentation for getting started there. 50 51Further documentation 52------------ 53The EXA driver interface and public API is documented using doxygen in 54xserver/xorg/exa/. To build the documentation, run: 55 doxygen -g 56 doxygen Doxyfile 57The resulting documentation will appear an html/index.html under the current 58directory. 59 60EXA initialization 61------------------ 62Your driver's AccelInit routine must initialize an ExaDriverRec structure if 63EXA support is enabled, with appropriate error handling (i.e. NoAccel and 64NoXvideo should be set to true if EXA fails to initialize for whatever 65reason). 66 67The AccelInit routine also needs to make sure that there's enough offscreen 68memory for certain operations to function, like Xvideo, which should advertise 69a maximum size no larger than can be dealt with given the amount of offscreen 70memory available. 71 72EXA and Xv 73---------- 74Video support becomes easier with EXA since AllocateFBMemory can use 75exaOffscreenAlloc directly, freeing a previous area if necessary and 76allocating a new one. Likewise, FreeFBMemory can call exaOffscreenFree. 77 78EXA teardown 79------------ 80At screen close time, EXA drivers should call exaDriverFini with their screen 81pointer, free their EXADriver structure, and do any other necessary teardown. 82 83EXA misc. 84--------- 85In many drivers, DGA support will need to be changed to be aware of the new 86EXA support. 87 88Send updates and corrections to Jesse Barnes <jbarnes@virtuousgeek.org> or 89just check them in if you have permission. 90