Advertisement

Programming with X

Started by March 09, 2005 11:40 AM
11 comments, last by Prefect 19 years, 8 months ago
First of all, if you want to go "behind the scenes" and actually hack on the X server yourself, do yourself a favour and ignore the proprietary drivers from NVidia and ATI, at least in the beginning. Without access to their source code, you'll be missing *a lot* of crucial code.

Now as far as drivers in userspace are concerned, I suggest you read up on how the DRI works. That's the opensource architecture for 3D accelerated drivers (ATI's proprietary driver is in fact based on the DRI). It's a mix of exokernel and microkernel, with a hint of monolithic thrown in for the aroma.

In the process, I hope you learn that userspace drivers are essential for good performance, and that at the same time, there are in fact efforts to greatly improve the design of X windows and all things related to graphics on Linux. For example, it is possible to run straight fbdev+DRI, without the X server; however, this is still rather hacky and a work-in-progress. In the long term, however, it will allow us to remove most of the DDX (the hardware driver) from the X server, which in turn will clean up the overall design and allow the X server to run as a non-root process.

If you're interested in lowlevel graphics hacking on Linux, this is really where you should focus on. Oh, and driver development, of course - I'm still waiting for someone to come forward and reverse engineer the Geforces' hardware interface :)

cu,
Prefect
Widelands - laid back, free software strategy
Quote: Original post by sakky
I'm interested in X it's self because the NVIDIA driver. But I seam to have forgot about the NVIDIA module that doesn't need X at all.


The NVIDIA kernel module does not need X, but it implements a proprietry interface which interfaces with the NVIDIA X driver itself.

You won't be able to usefully do anything with just the kernel module. This is essentially an internal component of NVIDIA's driver and doesn't implement any documented interface.

It probably also doesn't implement the majority of functions.

Quote:
From my understanding, all I need is the interface to the module and I can do what ever I want with it.


Then your understanding is wrong, I'm afraid.

Quote:
So I wouldn't need X to run my GeForce I only need the module interfaces that came with the driver. I'm more concerned about hardware acceleration and OpenGL.


OpenGL *needs* X. X arbitrates access to the device and manages the windows etc. Xlib provides the basis for the GLX library which allows the application to create OpenGL contexts.

Without an opengl context, opengl is useless.

The NVIDIA driver has several components - but the only one which is programmed directly is the opengl library.

Mark
Advertisement
Quote:
OpenGL *needs* X. X arbitrates access to the device and manages the windows etc. Xlib provides the basis for the GLX library which allows the application to create OpenGL contexts.


While this is currently true for all practical purposes, and it is definitely true for the NVidia driver, it is not true to somebody who is interested in low-level graphics hacking.

Look around for Mesa Sola/miniglx: It's a hack that allows you to use the open-source DRI drivers on fbdev without an X server. It is quite likely that this (together with fbdev+DRI merging) will evolve into the basis for an "X-on-GL" X server.

cu,
Prefect
Widelands - laid back, free software strategy

This topic is closed to new replies.

Advertisement