Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

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

    Write something...
    Last edited by siavashserver; 23 February 2017, 07:33 AM.

  • #2
    Originally posted by siavashserver View Post
    We are going to assume that target audience (newbie) does already have a solid knowledge of C programming language.
    Knowledge of C alone is from little to no help at all
    ## VGA ##
    AMD: X1950XTX, HD3870, HD5870
    Intel: GMA45, HD3000 (Core i5 2500K)

    Comment


    • #3
      Originally posted by siavashserver View Post
      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).

      Have fun.

      Comment


      • #4
        Originally posted by siavashserver View Post
        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:


        Originally posted by siavashserver View Post
        2) Where to access source code, fork and start developing?
        http://cgit.freedesktop.org/mesa/mesa/ - OpenGL driver
        http://cgit.freedesktop.org/xorg/driver/xf86-video-ati/ - X driver
        http://cgit.freedesktop.org/mesa/drm/ - some shared code between the two above
        http://cgit.freedesktop.org/~agd5f/linux/ - Alex's kernel tree with latest stuff for Radeon
        http://llvm.org/docs/GettingStarted.html - The shader compiler backend for Southern Islands lives in LLVM, so you might need that too.

        Originally posted by siavashserver View Post
        3) What compiler switches and libraries should be used during development?
        That's up to you.

        Originally posted by siavashserver View Post
        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 View Post
        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 View Post
        6) How is Mesa and open source drivers source code structured? (Related directories and files)
        mesa/src/mesa/main - the OpenGL front-end
        mesa/src/mesa/state_tracker - the OpenGL middle-end
        mesa/src/gallium/drivers/radeonsi - the hardware driver (API-independent back-end)

        And there is also a lot of code in various directories of Mesa that the 3 parts above use.

        Originally posted by siavashserver View Post
        7) How do drivers work internally? (Important functions and their calling order)
        The source code is your documentation.

        Originally posted by siavashserver View Post
        8) Where are the usual hot spots and how to profile the code?
        You must know the hardware to be able to see where bottlenecks might occur. For CPU profiling, you can use e.g. sysprof.

        Originally posted by siavashserver View Post
        9) What is usual coding conventions and styles being used?
        It depends on the project. See the source code. Various parts of Mesa have different styles.

        Originally posted by siavashserver View Post
        10) What kind of tasks should newbies start with? Is there any list?
        Feel free to ask on the appropriate mailing list. [email protected] can be a good start.

        Originally posted by siavashserver View Post
        11) Who and where to ask when in trouble?
        Same as above.

        Comment


        • #5
          Originally posted by siavashserver View Post
          4) How is work flow of development and testing drivers happening? (Dual boot, virtual machines, etc)
          For testing OpenGL, we use piglit:

          Comment


          • #6
            Originally posted by siavashserver
            That's interesting, I thought that involves complete system reboot.
            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.

            Originally posted by siavashserver
            For code debugging and profiling process, debug symbols are required. Is it necessary to manually compile Linux kernel beside Mesa and Radeon drivers too?
            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.

            Comment


            • #7
              Ian Romanick posted a wiki with some project suggestions for people wanting to get into Mesa development. Hopefully, experienced people will avoid these projects.

              See: http://wiki.freedesktop.org/dri/NewbieProjects/

              The announcement: http://lists.freedesktop.org/archive...er/048905.html

              Comment


              • #8
                Originally posted by siavashserver
                It looks like all those tasks are new OpenGL 4 extensions. Is it possible for newbies owning OpenGL 3 capable and older graphics cards to pick up those?
                Yes, those extensions can be supported on GL2 and later hardware.

                Comment


                • #9
                  Originally posted by siavashserver
                  I had a look at supported extensions by FGLRX for my 4890, but none of them is supported. Is that a show stopper?

                  Here is the list of supported OpenGL extensions: http://pastebin.kde.org/pglnnibhx
                  Don't worry that the closed driver doesn't support it. Your driver is probably older than the extensions!

                  Comment


                  • #10
                    Most things have been answered here already but just a couple of things to add:

                    Originally posted by siavashserver View Post
                    6) How is Mesa and open source drivers source code structured? (Related directories and files)
                    In the mesa source:
                    docs/sourcetree.html - Has an overview of the directory structures

                    Originally posted by siavashserver View Post
                    9) What is usual coding conventions and styles being used?
                    In the mesa source:
                    docs/devinfo.html - Provides some tips to new developers including coding styles information.


                    These files are also avaliable on the Mesa website but they not as up to date.

                    Comment

                    Working...
                    X