Accelerated Graphic Cards: Difference between revisions

m
no edit summary
[unchecked revision][unchecked revision]
mNo edit summary
 
(9 intermediate revisions by 2 users not shown)
Line 1:
While it is nice to have some graphics on the screen, it would be even nicer to have the video card do the dirty work. Beware though, things are not always as easy as they seem.
<!-- Alternative [[VESA BIOS Extension/Accelerator Functions]] (this doesn't seem to be updated for a decade, probably best to delete this instead) -->
 
== Cards with documentation ==
 
=== 3Dfx ===
These are a sort of good news for 3dfx cards (those with a Voodoo chipset). These cards could be the only ones with relatively fast 3D support (Glide/OpenGL) and [http://darwin-3dfx.sourceforge.net/ open specifications]. Voodoo cards are still available from sources such as eBay.
Line 16 ⟶ 15:
 
=== ATI/AMD ===
AMD [[topic:14887|started inSince September 2007]], toAMD openstarted upopening theup specifications for their recent GPUs.
The ones regarding a R630 or M56 chip can be downloaded from [https://www.x.org/docs/AMD/old/ X.org].
 
Since early 2014, AMD maintains up to date open programming guides for all their GPUs, including ana specific email address for support.
 
X.org provides a documentation for AMD GPUs in [https://www.x.org/wiki/RadeonFeature/#index13h2 their website]. An official AMD Open GPU documentation is also available inon [https://developer.amd.com/resources/developer-guides-manuals/#open_gpu AMD's website] and an implementation for the Linux kernel is available inon [https://github.com/GPUOpen-Drivers/AMDVLK GitHub].
 
=== NVIDIA ===
Line 30 ⟶ 29:
-->
 
NVIDIA now provides official documentations for most of their GPUs [https://nvidia.github.io/open-gpu-doc/ on GitHub] and open sourced their Linux kernel module for their GPUs [https://github.com/NVIDIA/open-gpu-kernel-modules also on GitHub]. Before NVIDIA officially open sourced their GPU stuff, there are many NVIDIA GPU reverse engineering projectprojects like [http://nouveau.freedesktop.org Nouveau] and [https://github.com/envytools/envytools EnvyTools] and a group of hackers even leaked most of theNVIDIA's GPU stuff like documentation and even full-on reference FPGA codecodes, which led to NVIDIA officially open sourcing of their GPU documentation and Linux kernel module. Most of these reverse engineering project aren't complete likeunlike NVIDIA's official documentation but you can still use it as an another source of NVIDIA GPU documentation in addition with NVIDIA's official open source documentation.
 
=== VMware SVGA-II ===
Not exactly aan cardactual GPU, but the [[VMWare SVGA-II]] device makes for a nice virtual machine device for some 3D acceleration. It is available on both VMware and QEMU. A well-documented and easy-to-port reference driver has also been made available by VMware under the MIT license. Although it is deprecated, the device works perfectly fine under QEMU and is relatively simple to work with, thus it makes for a very good starting point for graphics acceleration. Reference driver available at [http://vmware-svga.sourceforge.net/index.old.html the old vmware-svga page on sourceforgeSourceForge].
 
== Where can I find low-level information about NVIDIA/, AMD/Matrox/other, 3Dand other graphic cards? ==
Good question. Unless you find something else, there is virtually no information publicly available (for free or otherwise) about the internal workings of current 3D graphics cardsGPUs. There are only small bits that are relevant to game programmers but nothing an OS developer could use.
 
Now, if you have a VIA graphicsintegrated chipGPU, things may be better since they recently released an [http://linux.via.com.tw/ open source driver] for both 2D and 3D operations.
Good question. Unless you find something else, there is virtually no information publicly available (for free or otherwise) about the internal workings of current 3D graphics cards. There are only small bits that are relevant to game programmers but nothing an OS developer could use.
 
Now, if you have a VIA graphics chip, things may be better since they recently released an [http://linux.via.com.tw/ open source driver] for both 2D and 3D operations.
 
There are virtually no tutorials or datasheets for the 2D acceleration features either, but at least we have open-source code for them. Among other sources, the Xfree drivers, [https://github.com/haiku/haiku/tree/master/src/add-ons/accelerants Haiku (was Open BeOS) accelerants] and [http://www.shawnhargreaves.com/freebe/ FreeBE/AF]. They may provide enough information to reverse-engineer and figure out a model that could be used to program/port for your environment. Some older cards with only 2D acceleration might be documented by the [https://pdos.csail.mit.edu/6.828/2018/readings/hardware/vgadoc/ VGADoc] ([https://pdos.csail.mit.edu/6.828/2018/readings/hardware/vgadoc4b.zip vgadoc4b.zip], also on [https://github.com/achernya/iap-6.828-website/tree/master/readings/hardware/vgadoc Github]).
 
There are virtually no tutorials or datasheets for the 2D acceleration features either, but at least we have open-source code for them. Among other sources, the XfreeX.org/XFree86 drivers, [https://github.com/haiku/haiku/tree/master/src/add-ons/accelerants Haiku (was Open BeOS) accelerants] and [http://www.shawnhargreaves.com/freebe/ FreeBE/AF]. They may provide enough information to reverse-engineer and figure out a model that could be used to program/port for your environment. Some older cardsGPUs with only 2D acceleration might be documented by the [https://pdos.csail.mit.edu/6.828/2018/readings/hardware/vgadoc/ VGADoc] ([https://pdos.csail.mit.edu/6.828/2018/readings/hardware/vgadoc4b.zip vgadoc4b.zip], also on [https://github.com/achernya/iap-6.828-website/tree/master/readings/hardware/vgadoc GithubGitHub]).
Anyone who wishes to put time into that kind of research is welcome to post their results here.
 
== What can 2D acceleration do for me? ==
 
* Hardware mouse cursor, drawn and managed (e.g. you provide coordinates, the card does the rest)
* Bitblt (for "'''BIT''' '''BL'''ock '''T'''ransfer") can be used for screen-to-screen memory copy like window moving, scrolling, etc. You provide from and to boxes and the card does the rest. Some might know this as the "rasterop" or remember the hardware "blitter" in Amiga computers.
Line 52 ⟶ 48:
 
== How do 3D-accelerated programs talk to 3D-accelerating hardware? ==
 
Let's assume that you have a strong knowledge of OpenGL and that you don't need it covered here. If you take the example of NVIDIA's GPU driver for Linux (if you have a correctly configured NVIDIA GPU, you can see almost all this by a simple "strace" on a 3D program in linux), things are organized this way:
 
* Two libraries libGL.so and libGLcore.so will be loaded by any program that wishes to do accelerated 3D operations. Upon startup, those libraries open "/dev/nvidiactl" and "/dev/nvidia0".
<!-- Since the kernel module is now open sourced, should this section removed completely? -->
* The kernel module is made of an "obscure" file nv-kernel.o which contains only "anonymized" symbols and anthe "open source" part that mainly glues the nv-kernel (which is actually almost system transparent) to the linuxLinux kernel.
* The actual "conversation" between the library and the driver cannot be traced by conventional means: /dev/nvidia* only allows "ioctl" operations and mmap. The values you can observe in "/proc/XXXXX/maps" while the 3D program is running, which let meus believe the driver actually exposes the hardware resources (e.g. texture space, vertex space, etc) directly to the library. Current linuxLinux kernels can however be compiled with the mmiotrace option which can then be used to log all individual accesses to mmapped space.
 
l /proc/pci
Line 84 ⟶ 79:
 
== External links ==
* [[topic:23548|A topic on duplicating/reverse engineering existing driver code]]
 
[[Category:Video]]
Anonymous user