Raspberry Pi VC4

Using the "VC4" driver on the raspberry pi to enable hardware acceleration (in X, Wayland, opengl applications) presents many challenges. There's plenty of instructions floating around for Raspbian, but for Gentoo, not so much. This page contains a couple of nuggets of wisdom that may help you get there.

Kernel
To have proper GPU acceleration with VideoCore, you need its kernel module loaded. That module has been integrated in v4.5, but it's also present in rpi's kernel v4.4.

To get VC4 core working you need to use latest firmware from 9999 ebuild. To have installed only firmware files and not kernel - follow this guide modifying ebuild file.

Mesa and friends
Before enabling kernel module and switching RPi to GPU you need to rebuild with support of VideoCore4. To do so add following to your :

And rebuild.

It is also a good idea to add  as global use flags.

Enabling the VC4 kernel module
Once you have mesa VC4 support you can enable kernel module and try to switch to VC4 GPU.

To enable the kernel module, you have to enable the optional overlay in your with. It's also recommended to bump your gpu_mem to  (it's what  does when you enable the driver through it).

Make sure that you've installed latest version of or you'll have a blank screen!

Also, you should know that because that driver is a kernel module, you won't have any HDMI output until it's loaded, which is somewhere in the middle of your init procedure.

Is my module loaded?
Once you're booted up, you can verify that your module is properly loaded with. You're supposed to have a  module in there. Also, it's important to verify that exists. If you don't have that device, nothing's going to work.

Is it working?
To test your setup, you need to install. This provides, which you can run with. If you have something like  in the output, then it's a success! If it's using, you're almost there. If it's using the software rasterizer, you're not there.

If it is using  and  exists, try to remove   from that file.