How to get involved with open source Radeon driver development (Newbie Friendly)

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

How to get involved with open source Radeon driver development (Newbie Friendly)

I'm sure there is a lot of people out there whose inner hackers wants to someday get involved with open source Radeon driver or Mesa development, but lack of introductory and scattered material makes it to look like a black box to them. So I'm asking developers involved with Mesa and open source drivers development to take a part in this discussion and share their experience.

We are going to assume that target audience (newbie) does already have a solid knowledge of C programming language.

1) First things first. What is usual set of documents, tool chain and software required to develop, test and debug drivers by developers?

2) Where to access source code, fork and start developing?

3) What compiler switches and libraries should be used during development?

4) How is work flow of development and testing drivers happening? (Dual boot, virtual machines, etc)

5) Is it mandatory to have access to multiple generations of hardware to get started?

6) How is Mesa and open source drivers source code structured? (Related directories and files)

7) How do drivers work internally? (Important functions and their calling order)

I'm sure there is a lot of people out there whose inner hackers wants to someday get involved with open source Radeon driver or Mesa development, but lack of introductory and scattered material makes it to look like a black box to them. So I'm asking developers involved with Mesa and open source drivers development to take a part in this discussion and share their experience.

We are going to assume that target audience (newbie) does already have a solid knowledge of C programming language.

1) First things first. What is usual set of documents, tool chain and software required to develop, test and debug drivers by developers?

2) Where to access source code, fork and start developing?

3) What compiler switches and libraries should be used during development?

4) How is work flow of development and testing drivers happening? (Dual boot, virtual machines, etc)

5) Is it mandatory to have access to multiple generations of hardware to get started?

6) How is Mesa and open source drivers source code structured? (Related directories and files)

7) How do drivers work internally? (Important functions and their calling order)

8) Where are the usual hot spots and how to profile the code?

9) What is usual coding conventions and styles being used?

10) What kind of tasks should newbies start with? Is there any list?

11) Who and where to ask when in trouble?

Feel free to add your own if anything necessary is missed.

Go to the mailing list and ask for any introductory projects. All the rest will be answered once you start working on the code (from git).

Go to the mailing list and ask for any introductory projects. All the rest will be answered once you start working on the code (from git).

Have fun.

Mailing lists usually eat messages and they are hard to search and follow by newbies. Main reason I'm discussing this in Phoronix forum is because that it is optimized for search engines and there is a high chance to show up on first page of Google search results, so it can be available to everybody. This also helps to have an all-in-one place for frequently asked questions rather than scattered information on mailing lists.

I'm sure there is a lot of people out there whose inner hackers wants to someday get involved with open source Radeon driver or Mesa development, but lack of introductory and scattered material makes it to look like a black box to them. So I'm asking developers involved with Mesa and open source drivers development to take a part in this discussion and share their experience.

We are going to assume that target audience (newbie) does already have a solid knowledge of C programming language.

1) First things first. What is usual set of documents, tool chain and software required to develop, test and debug drivers by developers?

That's up to you. The source code is your documentation. It's also very useful to have good knowledge of OpenGL, shader languages, etc. If you don't know OpenGL, I can't help you.

The hardware documentation is here, but good knowledge of OpenGL and/or Direct3D is assumed if you want to understand the 3D docs:http://www.x.org/docs/AMD/

3) What compiler switches and libraries should be used during development?

That's up to you.

Originally Posted by siavashserver

4) How is work flow of development and testing drivers happening? (Dual boot, virtual machines, etc)

I either install the components with "make install" or make symlinks in /usr/lib which point to .so files in my home, so that I don't have to install anything. Drivers are just libraries, so I can compile them and use them immediatelly.

Originally Posted by siavashserver

5) Is it mandatory to have access to multiple generations of hardware to get started?

No, you only need the card you want to work with.

Originally Posted by siavashserver

6) How is Mesa and open source drivers source code structured? (Related directories and files)

That's up to you. The source code is your documentation. It's also very useful to have good knowledge of OpenGL, shader languages, etc. If you don't know OpenGL, I can't help you.

I've basic knowledge of how graphics engines and OpenGL are working and I know how to load models, create buffers, setup shaders and start rendering with OpenGL 3.

Originally Posted by marek

The hardware documentation is here, but good knowledge of OpenGL and/or Direct3D is assumed if you want to understand the 3D docs:http://www.x.org/docs/AMD/

I'm going to put a few links to OpenGL tutorials for guys who want to get involved here. Don't expect to be able to create a full-fledged graphics engine, but these should be enough to get you started:

I either install the components with "make install" or make symlinks in /usr/lib which point to .so files in my home, so that I don't have to install anything. Drivers are just libraries, so I can compile them and use them immediatelly.

That's interesting, I thought that involves complete system reboot.

Originally Posted by marek

The source code is your documentation.

Today I was digging into agd5f blog, this post might give a good overview to newcomers:

It depends on the component you're working on.
1) If it's the kernel part of the driver, you need a complete reboot. The kernel mostly does low-level tasks like mode setting, memory management, and sending commands to the hardware. If you work on those, you'll reboot very often.
2) If it's the X driver, you need to restart X (just log out and log in)
3) If it's the Mesa OpenGL driver, you only need to restart the app that you test with, because the OpenGL driver is loaded when an OpenGL context is created. It's the same for VDPAU and OpenCL.

If there is a new feature or fix in the kernel driver that you need, then yes. I regularly build and install these components from git: kernel, libdrm, mesa, xf86-video-ati, llvm, piglit. For the kernel, I usually fetch Alex's or Dave's tree.

Originally Posted by siavashserver

During which step of development do you guys test your code with open source games and other demanding applications? (or Phoronix test suit)

When a new feature is being added, we use the Piglit test suite. We don't usually commit patches without running piglit first and making sure there are no regressions. I usually test games and benchmarks because of bug reports, or because I want to see how a particular driver performs.