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.

I could never manage to compile a kernel that had a functional VC4 module myself, so I piggy-backed on Raspbian pre-compiled v4.4 kernel. To do so, I simply installed Raspbian on an SD card and changed the rootfs kernel argument to point to my gentoo system. Then, I copied  from the Raspbian system into my gentoo system.

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

Make sure that you've copied kernel modules from the Raspbian system, 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.