]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
accel/ivpu: Add support for user-managed preemption buffer
authorAndrzej Kacprowski <Andrzej.Kacprowski@intel.com>
Mon, 15 Sep 2025 10:34:37 +0000 (12:34 +0200)
committerKarol Wachowski <karol.wachowski@linux.intel.com>
Thu, 18 Sep 2025 06:42:38 +0000 (08:42 +0200)
commit0bf37f45d5c472aebdf32da64775cac1110c085c
tree7af5973bbbaf197eddec6d4031e5ff90e4904179
parent58b8b085b963008e25a20338a5e6ab64e10cab84
accel/ivpu: Add support for user-managed preemption buffer

Allow user mode drivers to manage preemption buffers, enabling
memory savings by sharing a single buffer across multiple
command queues within the same memory context.

Introduce DRM_IVPU_PARAM_PREEMPT_BUFFER_SIZE to report the required
preemption buffer size as specified by the firmware.

The preemption buffer is now passed from user space as an entry
in the BO list of DRM_IVPU_CMDQ_SUBMIT. The buffer must be
non-mappable and large enough to hold preemption data.

For backward compatibility, the kernel will allocate an internal
preemption buffer if user space does not provide one.

User space can only provide a single preemption buffer,
simplifying the ioctl interface and parameter validation.
A separate secondary preemption buffer is only needed
to save below 4GB address space on 37xx and only if preemption
buffers are not shared.

Signed-off-by: Andrzej Kacprowski <Andrzej.Kacprowski@intel.com>
Reviewed-by: Lizhi Hou <lizhi.hou@amd.com>
Signed-off-by: Karol Wachowski <karol.wachowski@linux.intel.com>
Link: https://lore.kernel.org/r/20250915103437.830086-1-karol.wachowski@linux.intel.com
drivers/accel/ivpu/ivpu_drv.c
drivers/accel/ivpu/ivpu_fw.c
drivers/accel/ivpu/ivpu_fw.h
drivers/accel/ivpu/ivpu_gem.h
drivers/accel/ivpu/ivpu_job.c
drivers/accel/ivpu/ivpu_job.h
include/uapi/drm/ivpu_accel.h