OSDN Git Service

accel/ivpu: Add command buffer submission logic
authorJacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Tue, 17 Jan 2023 09:27:22 +0000 (10:27 +0100)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Thu, 19 Jan 2023 10:12:00 +0000 (11:12 +0100)
commitcd7272215c44676dba236491941c6c406701cc5e
treee97a05cd4d479ebaaad330dfdb051feea8231a5e
parent02d5b0aacd0590dbaf25f35834631e5bc11002e3
accel/ivpu: Add command buffer submission logic

Each of the user contexts has two command queues, one for compute engine
and one for the copy engine. Command queues are allocated and registered
in the device when the first job (command buffer) is submitted from
the user space to the VPU device. The userspace provides a list of
GEM buffer object handles to submit to the VPU, the driver resolves
buffer handles, pins physical memory if needed, increments ref count
for each buffer and stores pointers to buffer objects in
the ivpu_job objects that track jobs submitted to the device.
The VPU signals job completion with an asynchronous message that
contains the job id passed to firmware when the job was submitted.

Currently, the driver supports simple scheduling logic
where jobs submitted from user space are immediately pushed
to the VPU device command queues. In the future, it will be
extended to use hardware base scheduling and/or drm_sched.

Co-developed-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Signed-off-by: Andrzej Kacprowski <andrzej.kacprowski@linux.intel.com>
Signed-off-by: Jacek Lawrynowicz <jacek.lawrynowicz@linux.intel.com>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Reviewed-by: Jeffrey Hugo <quic_jhugo@quicinc.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20230117092723.60441-7-jacek.lawrynowicz@linux.intel.com
drivers/accel/ivpu/Makefile
drivers/accel/ivpu/ivpu_drv.c
drivers/accel/ivpu/ivpu_drv.h
drivers/accel/ivpu/ivpu_gem.c
drivers/accel/ivpu/ivpu_gem.h
drivers/accel/ivpu/ivpu_job.c [new file with mode: 0644]
drivers/accel/ivpu/ivpu_job.h [new file with mode: 0644]
include/uapi/drm/ivpu_accel.h