Skip to content

v3dv: Introduce CPU jobs

Maíra Canal requested to merge mairacanal/mesa:v3dv/v5/cpu-job into main

This MR implements a new type of V3D job, a CPU job, which was recently added to the kernel. A CPU job is a job that requires CPU intervention. It is nice to perform these operations on the kernel space as we can attach multiple in/out syncobjs to it.

Why do we want a CPU job on the kernel?

There are some Vulkan commands that cannot be performed by the GPU, so we implement those as CPU jobs on Mesa. But to synchronize a CPU job in the user space, we need to hold part of the command submission flow in order to synchronize their execution correctly.

By moving the CPU job to the kernel, we can make use of the DRM schedule queues and all the advantages it brings with it. This way, instead of stalling the submission thread, we can use syncobjs to synchronize the job, providing a more effective management.

What is the idea of this MR?

Implement support in Mesa for the new CPU job ioctl added on the kernel side. This will enable us to perform several jobs that we were being performed in Mesa on the kernel side.

When CPU jobs landed in the kernel?

I pushed the CPU job series to drm-misc-next today (Dec 1) and you can take a look at it here.


This series was tested with a custom kernel with the CPU jobs, as you can see here. For sure, this series also works in kernels without any CPU job capabilities.

Merge request reports