Announcement

Collapse
No announcement yet.

The Size Of The Different Open-Source Linux DRM/Mesa Graphics Drivers

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

  • The Size Of The Different Open-Source Linux DRM/Mesa Graphics Drivers

    Phoronix: The Size Of The Different Open-Source Linux DRM/Mesa Graphics Drivers

    As there's been some discussion lately about the "size" of the different open-source Linux graphics drivers, here are some fresh looks at the rough code size of each of the main DRM/KMS kernel drivers as well as the Mesa/Gallium3D user-space drivers...

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Probably worth noting that:
    • you didn't count NIR which is another 40k lines of code and is used extensively by i965 and to a lesser extent by freedreno and vc4 (but not the other drivers)
    • radeonsi doesn't have a shader compiler at all, just an LLVM interface (a lot of which comes from gallivm, which you also didn't count -- 34k LOC in total, but that includes a ton of stuff radeonsi doesn't use)
    • llvmpipe/softpipe are the sole users of a ton of code that's not counted in your line counts
    OTOH I realize that it's a bit tricky to figure out what all the various inter-component dependencies are.

    Comment


    • #3
      Michael, why are you count all nouveau drivers in one row, but 3 different rows for each radeon driver?

      Comment


      • #4
        Originally posted by imirkin View Post
        Probably worth noting that:
        • you didn't count NIR which is another 40k lines of code and is used extensively by i965 and to a lesser extent by freedreno and vc4 (but not the other drivers)
        • radeonsi doesn't have a shader compiler at all, just an LLVM interface (a lot of which comes from gallivm, which you also didn't count -- 34k LOC in total, but that includes a ton of stuff radeonsi doesn't use)
        • llvmpipe/softpipe are the sole users of a ton of code that's not counted in your line counts

        OTOH I realize that it's a bit tricky to figure out what all the various inter-component dependencies are.
        Yeah, thanks for the clarification to help others understand. Was just intending for this to be a rough estimate as tried to imply by the small article just to get an idea for current sizes.
        Michael Larabel
        https://www.michaellarabel.com/

        Comment


        • #5
          Originally posted by yurikoles View Post
          Michael, why are you count all nouveau drivers in one row, but 3 different rows for each radeon driver?
          Just the way the directory layout and code is structured.
          Michael Larabel
          https://www.michaellarabel.com/

          Comment


          • #6
            When I'm reading source code statistics (like these), I often find it rather useless because there's so many factors that affect the numbers (libraries included in dir tree?). And I find the number of characters (~= #bytes) a lot more accurate than just # of lines, which heavily depends on code style (line length/wrapping, placement of curly braces).

            But by far the most important/interesting thing for me (as programmer with interest in tinkering with OSS code) is the ratio of 'comments per code', aka the percentage of comment characters vs code characters. Too many times I've abandoned attempts to improve/fix OSS code because there's no or very little comments. Especially Linux drivers I looked at (USB camera drivers, or OpenGL-related stuff) seem to suffer from this. And then there's X11 (aaargh!) with a seemingly near total lack of comments. And the comments that are present are often intended to indicate uncertainties about the workings or context of said code (aka "don't touch this, we don't know what will break").

            It would be nice to see a survey of OSS projects, with 'comment to code' percentages. Seems non trivial though, since it would have to ignore license boilerplate and commented out code chunks. Perhaps there already is an (open source) tool for this? I think it would be very interesting to compare the (publicly perceived) quality of the software compared to how well the code is commented.

            Comment


            • #7
              You might want to check out this tool: https://github.com/AlDanial/cloc
              cloc counts blank lines, comment lines, and physical lines of source code in many programming languages.
              It counts lines with comments etc. separately.

              Comment


              • #8
                Interesting. One minor point -- the amdkfd driver works with both radeon and amdgpu kernel gfx drivers.
                Test signature

                Comment


                • #9
                  You could also use sloccount, it does a pretty good job of counting lines & comments and supports different languages...
                  Last edited by VinceLe; 22 April 2019, 02:11 PM. Reason: typo

                  Comment

                  Working...
                  X