I am working on the Raspberry Pi 4 Mesa V3D driver

Yeah… this blog post is well overdue, but better late than never! So yes, I am currently working on progressing the Raspberry Pi 4 Mesa driver stack, together with my Igalian colleagues Piñeiro and Chema, continuing the fantastic work started by Eric Anholt on the Mesa V3D driver.

The Raspberry Pi 4 sports a Video Core VI GPU that is capable of OpenGL ES 3.2, so it is a big update from the Raspberry Pi 3, which could only do OpenGL ES 2.0. Another big change with the Raspberry Pi 4 is that the Mesa v3d driver is the driver used by default with Raspbian. Because both GPUs are quite different, Eric had to write an all new driver for the Raspberry Pi 4, and that is why there are two drivers in Mesa: the VC4 driver is for the Raspberry Pi 3, while the V3D driver targets the Raspberry Pi 4.

As for what we have been working on exactly, I wrote a long post on the Raspberry Pi blog some months ago with a lot of the details, but for those looking for the quick summary:

  • Shader compiler optimizations.
  • Significant Transform Feedback fixes and improvements.
  • Implemented OpenGL Logic Operations.
  • A bunch of bugfixes for Piglit test failures.
  • Set up a Continuous Integration system to identify regressions.
  • Rebased and merge Eric’s work on Compute Shaders.
  • Many bug fixes targeting the Khronos OpenGL ES Conformance Test Suite (CTS).

So that’s it for the late news. I hope to do a better job keeping this blog updated with the news this year, and to start with that I will be writing a couple of additional posts to highlight a few significant development milestones we achieved recently, so stay tuned for more!

7 thoughts on “I am working on the Raspberry Pi 4 Mesa V3D driver”

    1. All of that work is already upstream in Mesa’s 19.3 release. Unfortunately I can’t give you an ETA for when that would arrive to Raspberry Pi 4 users if that is what you’re asking for, that depends on the Raspberry Pi Foundation packaging and release process, which is handled by a different group of people.

  1. Hi Iago,

    thanks for your work on this! I am really excited for the future of the Pi 4 🙂

    Do I understand correctly that for the best performance one would want to use current mesa master (or 19.3.y) with v3d (notably on _armv7l_)? Is the vc4 kernel module even needed anymore on the Pi 4 or does it solely depend on the new v3d?
    Is there anything specific that distro maintainers need to keep in mind?

    Best regards,

    1. Hi Tim,

      yes, 19.3 contains some performance work, but also relevant bugfixes and OpenGL ES 3.1 which brings Compute Shaders. Master should be fine too, I think master has a couple of relevant performance improvements (mostly replacing fnv1a with xxhash for our hashing which seems to significantly improve performance in some cases) and also brings a new feature: Geometry Shaders.

      The vc4 kernel mode is still needed, we need both vc4 and v3d.

      As for other things that might be relevant to distro maintainers, in order to get GLES 3.1 with Mesa 19.3 you also need this kernel patch (which is already merged in the downstream rpi-4.19.y branch):

      A version of the same patch was also pushed upstream (through drm-misc-next) quite some time ago.

  2. Hey Iago,

    thanks for your answer 🙂

    Ok! That clears some troubles I had unterstanding 🙂
    Currently i am using the current rpi-4.19.y branch with both vc4 and v3d (basically defconfig) and just doublechecked: it’s indeed working, altough only for a session spawned by root. My normal user works and shows the right driver (glxinfo -B: http://dpaste.com/3WRVYQK )
    but the performance is horrible, with text morphing very slowly into each other on the terminal etc 🙂

    Could you elaborate which devices in /dev should need their permissions changed? I tried with /dev/vchiq and /dev/dri/* without any luck. Thanks a lot!

    1. Your user should at least be in the ‘video’ group, I am not quite sure about what other permissions it may need. If being in the video group is not sufficient I’d suggest to ask that same question on the raspberry pi forums.

Comments are closed.