Raspberry Pi's V3D Kernel Driver Prepares For "CPU Jobs" To Assist Vulkan

Written by Michael Larabel in Raspberry Pi on 6 September 2023 at 03:22 PM EDT. 21 Comments
RASPBERRY PI
Igalia developers are working on extending the Broadcom V3D DRM kernel graphics driver, which is most notably used by the latest Raspberry Pi devices, to support the notion of "CPU jobs" in kernel space to assist in their Vulkan support. These CPU jobs are for assisting the support where their Broadcom GPU driver isn't capable of some Vulkan commands and thus needs to be punted off and handled by the processor.

Due to the Broadcom GPU not adequately supporting some Vulkan commands, the Mesa Vulkan driver needs to compensate and make use of the CPU. As it stands right now that CPU work is handled by Mesa in user-space but the hope is to migrate it to kernel-space with this V3D CPU jobs feature.

By moving the work to kernel-space, multiple in/out synchronization objects can be attached to that work -- making it easier to handle than the existing user-space approach around synchronizing with the GPU. These CPU jobs by the V3D kernel driver can then leverage the DRM scheduler queues and enjoy more effective job management.

Raspberry Pi 4


MaĆ­ra Canal of Igalia explains in the proposed patch series:
"After we decided that we would like to have a CPU job implementation in the kernel, we could think about two possible implementations for this job: creating an IOCTL for each type of CPU job or using an user extension to provide a polymorphic behavior to a single CPU job IOCTL. We decided for the latter one.

We have different types of CPU jobs (indirect CSD jobs, timestamp query jobs, copy query results jobs...) and each of them have a common infrastructure, but perform different operations. Therefore, by using a single IOCTL that is extended by an user extension, we can reuse the common infrastructure - avoiding code repetition - and yet use the user extension ID to identify the type of job and depending on the type of job, perform a certain operation.
...
This patchset introduces the basic infrastructure of a CPU job with a new V3D queue (V3D_CPU) e new tracers. Moreover, it introduces six types of CPU jobs: an indirect CSD job, a timestamp query job, a reset timestamp queries job, a copy timestamp query results job, a reset performance queries job, and a copy performance query results job."

More details on these V3D CPU jobs via the patches that are now under review in working to ultimately improve the Vulkan support on Raspberry Pi single board computers.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week