home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / windows / x / i386unix / 215 < prev    next >
Encoding:
Text File  |  1993-01-05  |  8.9 KB  |  198 lines

  1. Newsgroups: comp.windows.x.i386unix
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!cbnewsk!cbnewsj!dwex
  3. From: dwex@cbnewsj.cb.att.com (david.e.wexelblat)
  4. Subject: Re: Adding support for new card -- instructions wanted
  5. Organization: AT&T
  6. Date: Tue, 5 Jan 1993 19:37:41 GMT
  7. Message-ID: <1993Jan5.193741.17355@cbnewsj.cb.att.com>
  8. References: <1993Jan2.095240.20788@zip.eecs.umich.edu>
  9. Lines: 187
  10.  
  11. In article <1993Jan2.095240.20788@zip.eecs.umich.edu> plph@quip.eecs.umich.edu (MarkMontague) writes:
  12. > XFree86 gurus, please help!
  13.  
  14. Sorry it took so long to get around to responding to this.  I haven't had
  15. the time to thing about this until now.  I hope the following is useful,
  16. and helps people out.  Others can feel free to add to this; this discussion
  17. will become the basis for a readme-type file in the next XFree86 release.
  18.  
  19. For anyone who wants to understand how the X11R5 server works, I highly
  20. recommend the following book:
  21.  
  22.     The X Window System Server
  23.     X Version 11, Release 5
  24.     Elias Israel and Erik Fortune
  25.     Digital Press, 1992
  26.     ISBN 1-55558-096-3
  27.     ISBN 0-13-972753-1 (Prentice Hall edition)
  28.     $45.95
  29.  
  30. This book is, unfortunately, incredibly weak in the area of accleration.
  31. It does provide a lot of concrete information about other parts of the
  32. server though.  It's a good investment.
  33.  
  34. > I have XFree86-1.1 running on my Linux system in monochrome 640x480 generic
  35. > mode.  I WOULD *REALLY* LIKE TO GET IT RUNNING IN 1024x768 noninterlaced, 256
  36. > COLORS.
  37. > Problem is, I have a Compaq QVision 1024/e (Triton) EISA video card.  I
  38. > installed the mit X11R5 and XFree86-1.1 sources, but have _no_idea_ what
  39. > I need to do to add a support for a new card.  I *do* have the technical
  40. > reference manual for the card, and it seems to be very complete.
  41. > If someone could give me some advice, I would be very grateful.
  42.  
  43. Well, I would think that the first step is to join the XFree86 beta 
  44. team (:->).  If you want to be able to pull from that group of experts,
  45. send email to xfree86@physics.su.oz.au.
  46.  
  47. Adding a new SVGA card is not that hard.  We'll deal with the other subjects
  48. later.  You can generally figure out most of what you need to do from the
  49. existing drivers in vga256/drivers/*, with the generic vga code in vga256/vga.
  50. I suggest that you get aquainted with the existing driver(s) before you
  51. tackle writing a new one.
  52.  
  53. Anyone who is interested in understanding SVGA operations should get a copy
  54. of the following book:
  55.  
  56.     Programmer's Guide to the EGA and VGA cards, 2nd ed.
  57.     Richard F. Ferraro
  58.     Addison-Wesley, 1990
  59.     ISBN 0-201-57025-4
  60.  
  61. You also need the technical reference manual for your chipset, which has
  62. all of the register definitions.  Another good resource is VGAKIT, which
  63. is a package of DOS-based software (in source) for manipulating SVGA
  64. chipsets.  It is BIOS-oriented, and hence is not directly usable for
  65. Unix, but it has a lot of good information.  Check with the Archie
  66. service for the latest version; I believe that it can always be found
  67. on wuarchive.wustl.edu.
  68.  
  69. Basically an SVGA driver consists of the following functions:
  70.  
  71.     - An identification function (which just returns as string that
  72.       uniquely identifies the chipset)
  73.     - A clock-setting function, which selects an available dot-clock
  74.       given its index
  75.     - A probe function, that returns TRUE if the SVGA installed is
  76.       the chipset supported by the driver, and FALSE otherwise.  It
  77.       also probes the chipset for other information (such as clocks
  78.       and memory), if the user hasn't supplied the info already.
  79.     - A VT-switch function that enables access to the SVGA registers
  80.       when the server VT is activated, and removes the access when
  81.       the server VT is deactivated.
  82.     - A mode restore function, which loads an SVGA mode (i.e. sets
  83.       up all the registers).
  84.     - A mode save function, which saves a copy of the current SVGA
  85.       mode (i.e. register settings).
  86.     - A mode initialization function, which fills in a data structure
  87.       with all of the necessary register settings to activate a
  88.       specified mode.
  89.     - A viewport-setting function that sets the displayed portion of
  90.       the VGA memory inside the virtual screen.
  91.     - Bank-setting functions to activate the portion of the SVGA 
  92.       memory that is accesible to the host.  A good SVGA chipset
  93.       will have two bank registers - a read bank, and a write bank.
  94.       There are functions to set each, and one to set them to the
  95.       same value.  XFree86 also supports single-bank chipsets (in
  96.       which case a flag is set in the driver.c file, and all three
  97.       bank functions do the same thing).  The Trident driver is a
  98.       single-bank driver; compar it to the others for a clear
  99.       understanding of what's going on here.
  100.  
  101. Most of this is fairly straightforward, as you basically only have to
  102. worry about extended registers (i.e. not common VGA registers).  The
  103. vga/vgaHW.c file has functions that do the vast majority of the work
  104. for you.
  105.  
  106. Once you have all of these functions implemented, create a directory
  107. vga256/drivers/MyDriver, and create the driver.c and bank.s files.  Copy
  108. one of the other driver's Imakefile, and modify it as appropriate.
  109. Then go to mit/config, and add your new driver to the X386Vga256Drivers
  110. definition.  Then perform the following steps to build your new driver:
  111.  
  112.     - In mit/config, do 'make Makefiles'
  113.     - In mit/server, do 'make Makefile'
  114.     - In mit/ddx/x386, do 'make Makefile; make Makefiles depend all'
  115.     - In mit/server, do 'make loadX386'
  116.  
  117. You can verify that your driver was correctly linked it by executing
  118. './X386 -showconfig', which will show all of the configured drivers.
  119. The string from your Ident() function should be listed, along with the
  120. other drivers from X386Vga256Drivers.
  121.  
  122. After your color driver is working, make whatever changes might be necessary
  123. for the monochrome server (again, use the existing drivers as examples).
  124. Create a directory vga2/drivers/MyDriver, and create an Imakefile in
  125. it (the driver.c and bank.s files will be symbolically linked from
  126. the vga256 directory).  The do as above, except that you add your
  127. driver name to X386Vga2Drivers, and do 'make loadX386mono'.
  128.  
  129. A good way to learn about a new chipset is to work with a DOS mode-setting
  130. program (most, if not all, SVGA's come with one), and write a program
  131. that reads the various registers and prints them out.  This will help you
  132. understand what registers you need to be concerned with.
  133.  
  134. When hacking display drivers it is a VERY good idea to have a dumb terminal
  135. or a network connection to your machine.  You are very likely to screw up
  136. your display, and it's nice to be able to recover from this without having
  137. to hit the BRS (Big Red Switch).
  138.  
  139. > Also, the card has a BitBLT engin, line drawing engin, hardware graphics
  140. > cursor, and support for tiling.  I presume that there is no way to take
  141. > advantage of these without extensive modifications of the server.
  142.  
  143. Yes, extensive modifications are required.  The reason is that these
  144. types of operations involve significant changes to the frame-buffer code
  145. in the server.  As far as I know, there is no really good documentation
  146. on how to do this type of programming.  And I'm certainly in no position
  147. to give more than hints, since I've never done it.  However, there are
  148. currently beta-level servers that support 8514/A and S3 chipsets, based
  149. on the stock X11R5 code (not on XFree86).  And at least one person is
  150. working on merging the S3 support back into XFree86 (I can't comment
  151. on when that will be available).
  152.  
  153. Here are the contacts I know about (you guys can tell me that you don't
  154. want to deal with this any more, and I will remove you from this list
  155. before this file goes out with XFree86 1.2.  If I've left anyone off who
  156. wants to be included, please let me know).  Note that there is no
  157. connection between these guys and the XFree86 Core Team, other than the
  158. fact that some of them are on our beta-test team, and are merging some
  159. of their work into our work.
  160.  
  161.     Amancio Hasty <hasty@netcom.com> - Author of XS3, the X11R5-based
  162.         S3 server.  Supplies binaries for 386BSD (and X8514, too,
  163.         I believe).
  164.     Kevin Martin <martin@cs.unc.edu> - Author of X8514, the X11R5-based
  165.         8514 server (the "grandaddy" - basis for XS3, although XS3
  166.         has evolved considerably since then).  I'm not sure if
  167.         Kevin is doing any work in this area any more.
  168.     Jon Tombs <jon@robots.ox.ac.uk> - Working on integrating XS3 with
  169.         XFree86.  Don't bug him about when this will be done.  But
  170.         he is familiar with the S3 support.
  171.  
  172. > How does one go about adding support for a new graphics card to the server?
  173. > Thank you in advance for any help!
  174.  
  175. I hope this was helpful to you.
  176.  
  177. > Mark Montague
  178. > plph@caen.engin.umich.edu
  179. > -------------------------
  180. > P.S.  If anyone else out there has a QVision, please contact me!
  181.  
  182. Can you send me contact information, so I can obtain the technical reference
  183. for this chipset?  I'm trying to build a library.
  184.  
  185. --
  186. David Wexelblat <dwex@mtgzfs3.att.com>  (908) 957-5871
  187. AT&T Bell Laboratories, 200 Laurel Ave - 3F-428, Middletown, NJ  07748
  188.  
  189. "The meaning of life?  That's simple.  Try to be happy, try not to hurt
  190.  other people, and hope to fall in love."  -- Mallory Keaton
  191.