mbox series

[v1,0/7] New DRM driver for Intel VPU

Message ID 20220728131709.1087188-1-jacek.lawrynowicz@linux.intel.com (mailing list archive)
Headers show
Series New DRM driver for Intel VPU | expand

Message

Jacek Lawrynowicz July 28, 2022, 1:17 p.m. UTC
Hi,

This patchset contains a new Linux* Kernel Driver for Intel® VPUs.

VPU stands for Versatile Processing Unit and it is an AI inference accelerator
integrated with Intel non-server CPUs starting from 14th generation.
VPU enables efficient execution of Deep Learning applications
like object detection, classification etc.

Driver is part of gpu/drm subsystem because VPU is similar in operation to
an integrated GPU. Reusing drm driver init, ioctl handling, gem and prime
helpers and drm_mm allows to minimize code duplication in the kernel.

The whole driver is licensed under GPL-2.0-only except for two headers imported
from the firmware that are MIT licensed.

User mode driver stack consists of Level Zero API driver and OpenVINO plugin.
Both should be open-sourced by the end of Q3.
The firmware for the VPU will be distributed as a closed source binary.

Regards,
Jacek

Jacek Lawrynowicz (7):
  drm/vpu: Introduce a new DRM driver for Intel VPU
  drm/vpu: Add Intel VPU MMU support
  drm/vpu: Add GEM buffer object management
  drm/vpu: Add IPC driver and JSM messages
  drm/vpu: Implement firmware parsing and booting
  drm/vpu: Add command buffer submission logic
  drm/vpu: Add PM support

 MAINTAINERS                           |    8 +
 drivers/gpu/drm/Kconfig               |    2 +
 drivers/gpu/drm/Makefile              |    1 +
 drivers/gpu/drm/vpu/Kconfig           |   12 +
 drivers/gpu/drm/vpu/Makefile          |   16 +
 drivers/gpu/drm/vpu/vpu_boot_api.h    |  222 ++++++
 drivers/gpu/drm/vpu/vpu_drv.c         |  642 +++++++++++++++
 drivers/gpu/drm/vpu/vpu_drv.h         |  178 +++++
 drivers/gpu/drm/vpu/vpu_fw.c          |  417 ++++++++++
 drivers/gpu/drm/vpu/vpu_fw.h          |   38 +
 drivers/gpu/drm/vpu/vpu_gem.c         |  846 ++++++++++++++++++++
 drivers/gpu/drm/vpu/vpu_gem.h         |  113 +++
 drivers/gpu/drm/vpu/vpu_hw.h          |  163 ++++
 drivers/gpu/drm/vpu/vpu_hw_mtl.c      | 1040 +++++++++++++++++++++++++
 drivers/gpu/drm/vpu/vpu_hw_mtl_reg.h  |  468 +++++++++++
 drivers/gpu/drm/vpu/vpu_hw_reg_io.h   |  114 +++
 drivers/gpu/drm/vpu/vpu_ipc.c         |  480 ++++++++++++
 drivers/gpu/drm/vpu/vpu_ipc.h         |   91 +++
 drivers/gpu/drm/vpu/vpu_job.c         |  624 +++++++++++++++
 drivers/gpu/drm/vpu/vpu_job.h         |   73 ++
 drivers/gpu/drm/vpu/vpu_jsm_api.h     |  529 +++++++++++++
 drivers/gpu/drm/vpu/vpu_jsm_msg.c     |  220 ++++++
 drivers/gpu/drm/vpu/vpu_jsm_msg.h     |   25 +
 drivers/gpu/drm/vpu/vpu_mmu.c         |  944 ++++++++++++++++++++++
 drivers/gpu/drm/vpu/vpu_mmu.h         |   53 ++
 drivers/gpu/drm/vpu/vpu_mmu_context.c |  418 ++++++++++
 drivers/gpu/drm/vpu/vpu_mmu_context.h |   49 ++
 drivers/gpu/drm/vpu/vpu_pm.c          |  353 +++++++++
 drivers/gpu/drm/vpu/vpu_pm.h          |   38 +
 include/uapi/drm/vpu_drm.h            |  330 ++++++++
 30 files changed, 8507 insertions(+)
 create mode 100644 drivers/gpu/drm/vpu/Kconfig
 create mode 100644 drivers/gpu/drm/vpu/Makefile
 create mode 100644 drivers/gpu/drm/vpu/vpu_boot_api.h
 create mode 100644 drivers/gpu/drm/vpu/vpu_drv.c
 create mode 100644 drivers/gpu/drm/vpu/vpu_drv.h
 create mode 100644 drivers/gpu/drm/vpu/vpu_fw.c
 create mode 100644 drivers/gpu/drm/vpu/vpu_fw.h
 create mode 100644 drivers/gpu/drm/vpu/vpu_gem.c
 create mode 100644 drivers/gpu/drm/vpu/vpu_gem.h
 create mode 100644 drivers/gpu/drm/vpu/vpu_hw.h
 create mode 100644 drivers/gpu/drm/vpu/vpu_hw_mtl.c
 create mode 100644 drivers/gpu/drm/vpu/vpu_hw_mtl_reg.h
 create mode 100644 drivers/gpu/drm/vpu/vpu_hw_reg_io.h
 create mode 100644 drivers/gpu/drm/vpu/vpu_ipc.c
 create mode 100644 drivers/gpu/drm/vpu/vpu_ipc.h
 create mode 100644 drivers/gpu/drm/vpu/vpu_job.c
 create mode 100644 drivers/gpu/drm/vpu/vpu_job.h
 create mode 100644 drivers/gpu/drm/vpu/vpu_jsm_api.h
 create mode 100644 drivers/gpu/drm/vpu/vpu_jsm_msg.c
 create mode 100644 drivers/gpu/drm/vpu/vpu_jsm_msg.h
 create mode 100644 drivers/gpu/drm/vpu/vpu_mmu.c
 create mode 100644 drivers/gpu/drm/vpu/vpu_mmu.h
 create mode 100644 drivers/gpu/drm/vpu/vpu_mmu_context.c
 create mode 100644 drivers/gpu/drm/vpu/vpu_mmu_context.h
 create mode 100644 drivers/gpu/drm/vpu/vpu_pm.c
 create mode 100644 drivers/gpu/drm/vpu/vpu_pm.h
 create mode 100644 include/uapi/drm/vpu_drm.h

--
2.34.1

Comments

Dave Airlie Aug. 8, 2022, 2:34 a.m. UTC | #1
On Thu, 28 Jul 2022 at 23:17, Jacek Lawrynowicz
<jacek.lawrynowicz@linux.intel.com> wrote:
>
> Hi,
>
> This patchset contains a new Linux* Kernel Driver for Intel® VPUs.
>
> VPU stands for Versatile Processing Unit and it is an AI inference accelerator
> integrated with Intel non-server CPUs starting from 14th generation.
> VPU enables efficient execution of Deep Learning applications
> like object detection, classification etc.
>
> Driver is part of gpu/drm subsystem because VPU is similar in operation to
> an integrated GPU. Reusing drm driver init, ioctl handling, gem and prime
> helpers and drm_mm allows to minimize code duplication in the kernel.
>
> The whole driver is licensed under GPL-2.0-only except for two headers imported
> from the firmware that are MIT licensed.
>
> User mode driver stack consists of Level Zero API driver and OpenVINO plugin.
> Both should be open-sourced by the end of Q3.
> The firmware for the VPU will be distributed as a closed source binary.


Thanks for the submission, this looks pretty good and well layed out,

just a few higher level things, I think I'd like this name intel-vpu
or ivpu or something, VPU is a pretty generic namespace usage.

I think adding some sort of TODO file with what is missing and what
future things need to happen would be useful to know when merging this
might be a good idea.

I'm kinda thinking with a rename we could merge this sooner into a
staging-lite model.

I think I'd like Christian/Maarten to maybe review the fencing/uapi,
to make sure nothing too much is wrong there. The submit/waitbo model
is getting a bit old, and using syncobjs might be useful to make it
more modern. Is this device meant to be used by multiple users at
once? Maybe we'd want scheduler integration for it as well (which I
think I saw mentioned somewhere in passing).

Dave.
Stanislaw Gruszka Aug. 8, 2022, 2:49 p.m. UTC | #2
On Mon, Aug 08, 2022 at 12:34:59PM +1000, Dave Airlie wrote:
> On Thu, 28 Jul 2022 at 23:17, Jacek Lawrynowicz
> <jacek.lawrynowicz@linux.intel.com> wrote:
> >
> > Hi,
> >
> > This patchset contains a new Linux* Kernel Driver for Intel® VPUs.
> >
> > VPU stands for Versatile Processing Unit and it is an AI inference accelerator
> > integrated with Intel non-server CPUs starting from 14th generation.
> > VPU enables efficient execution of Deep Learning applications
> > like object detection, classification etc.
> >
> > Driver is part of gpu/drm subsystem because VPU is similar in operation to
> > an integrated GPU. Reusing drm driver init, ioctl handling, gem and prime
> > helpers and drm_mm allows to minimize code duplication in the kernel.
> >
> > The whole driver is licensed under GPL-2.0-only except for two headers imported
> > from the firmware that are MIT licensed.
> >
> > User mode driver stack consists of Level Zero API driver and OpenVINO plugin.
> > Both should be open-sourced by the end of Q3.
> > The firmware for the VPU will be distributed as a closed source binary.
> 
> 
> Thanks for the submission, this looks pretty good and well layed out,
> 
> just a few higher level things, I think I'd like this name intel-vpu
> or ivpu or something, VPU is a pretty generic namespace usage.

Thanks for the comments, we will consider renaming. 

> I think adding some sort of TODO file with what is missing and what
> future things need to happen would be useful to know when merging this
> might be a good idea.
> 
> I'm kinda thinking with a rename we could merge this sooner into a
> staging-lite model.

I'm not sure what we can add to TODO file, from driver perspective
I think it's pretty much ready for merging (except renaming), just
other components: F/W and user-space are not yet released.

> I think I'd like Christian/Maarten to maybe review the fencing/uapi,
> to make sure nothing too much is wrong there. The submit/waitbo model
> is getting a bit old, and using syncobjs might be useful to make it
> more modern. Is this device meant to be used by multiple users at
> once? Maybe we'd want scheduler integration for it as well (which I
> think I saw mentioned somewhere in passing).

The current approach with submit/wait_bo is simplistic but sufficient
for basic use case. In the future we are planning to add support for
HW based scheduling (we are also looking at SW scheduler) and we will
likely revisit submit/sync APIs at that time.

Regards
Stanislaw
Sam Ravnborg Aug. 8, 2022, 6:53 p.m. UTC | #3
Hi Stanislaw,

> I'm not sure what we can add to TODO file, from driver perspective
> I think it's pretty much ready for merging (except renaming), just
> other components: F/W and user-space are not yet released.
> 
> > I think I'd like Christian/Maarten to maybe review the fencing/uapi,
> > to make sure nothing too much is wrong there. The submit/waitbo model
> > is getting a bit old, and using syncobjs might be useful to make it
> > more modern. Is this device meant to be used by multiple users at
> > once? Maybe we'd want scheduler integration for it as well (which I
> > think I saw mentioned somewhere in passing).
> 
> In the future we are planning to add support for
> HW based scheduling (we are also looking at SW scheduler) and we will
> likely revisit submit/sync APIs at that time.

This is already two entries in the TODO file.

	Sam