Skip to contentSkip to conversation

Imagination Technologies PowerVR DRM driver

RFC PATCH Superseded Sarah Walker 4 participants 6 messages Apr 13, 2023 – Apr 18, 2023

Subsystems (5)

v2 of 8 Superseded Latest is v8 →

lore
Share & tools
lore
#0 lore raw

v2 cover Imagination Technologies PowerVR DRM driver

This patch adds the initial DRM driver for Imagination Technologies PowerVR GPUs, starting with those based on our Rogue architecture. It's worth pointing out that this is a new driver, written from the ground up, rather than a refactored version of our existing downstream driver (pvrsrvkm).

This new DRM driver supports:
- GEM shmem allocations
- dma-buf / PRIME
- Per-context (device node open) userspace managed virtual address space
- DRM sync objects (binary and timeline)
- Power management suspend / resume
- GPU job submission (geometry, fragment, compute, transfer)
- META firmware processor
- MIPS firmware processor
- Basic GPU hang recovery

Still to do:
- Document format of job streams and static context state
- GPU hang detection
- Handling for running out of parameter buffer space (this has made progress since RFC v1, but is still incomplete)

Currently our main focus is on our GX6250, AXE-1-16M and BXS-4-64 GPUs. Testing so far has been done using an Acer Chromebook R13 (GX6250 GPU) and a TI SK-AM62 board (AXE-1-16M GPU). An example SK-AM62 development board can be obtained
here: https://beagleboard.org/play

Firmware for the GX6250 and AXE-1-16M can be found here:
https://gitlab.freedesktop.org/frankbinns/linux-firmware/-/tree/powervr

A Vulkan driver that works with our downstream kernel driver has already been merged into Mesa [1][2]. Support for this new DRM driver is being maintained in a draft merge request [3], with the branch located here:
https://gitlab.freedesktop.org/frankbinns/mesa/-/tree/powervr-winsys

The Vulkan driver is progressing towards Vulkan 1.0. We're code complete, and are working towards passing conformance. This is a work in progress, so we're not sharing numbers just yet.

We are still looking at whether any functionality can be replaced with DRM common code. We are still considering drm_sched and the GPU VA manager.

The code in this patch, along with some of its history, can also be found here:
https://gitlab.freedesktop.org/frankbinns/powervr/-/tree/powervr-next

Sending this out now as it felt like a good point to get some feedback.

[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15243
[2] https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/src/imagination/vulkan
[3] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15507

v2:
* Redesigned and simplified UAPI based on RFC feedback from XDC 2022
* Support for transfer and partial render jobs
* Support for timeline sync objects

RFC v1: https://lists.freedesktop.org/archives/dri-devel/2022-August/367814.html

Sarah Walker (2):
drm/imagination: Add initial Imagination Technologies PowerVR driver
dt-bindings: gpu: Add Imagination Technologies PowerVR GPU

 .../devicetree/bindings/gpu/img,powervr.yaml  |  105 +
 drivers/gpu/drm/imagination/Kconfig           |   11 +
 drivers/gpu/drm/imagination/Makefile          |   36 +
 drivers/gpu/drm/imagination/pvr_ccb.c         |  380 +
 drivers/gpu/drm/imagination/pvr_ccb.h         |   51 +
 drivers/gpu/drm/imagination/pvr_cccb.c        |  390 ++
 drivers/gpu/drm/imagination/pvr_cccb.h        |  112 +
 drivers/gpu/drm/imagination/pvr_context.c     | 1428 ++++
 drivers/gpu/drm/imagination/pvr_context.h     |  412 ++
 drivers/gpu/drm/imagination/pvr_debugfs.c     |   53 +
 drivers/gpu/drm/imagination/pvr_debugfs.h     |   29 +
 drivers/gpu/drm/imagination/pvr_device.c      |  762 ++
 drivers/gpu/drm/imagination/pvr_device.h      |  760 ++
 drivers/gpu/drm/imagination/pvr_device_info.c |  223 +
 drivers/gpu/drm/imagination/pvr_device_info.h |  133 +
 drivers/gpu/drm/imagination/pvr_drv.c         | 1634 +++++
 drivers/gpu/drm/imagination/pvr_drv.h         |   89 +
 drivers/gpu/drm/imagination/pvr_dump.c        |  353 +
 drivers/gpu/drm/imagination/pvr_dump.h        |   17 +
 drivers/gpu/drm/imagination/pvr_free_list.c   |  559 ++
 drivers/gpu/drm/imagination/pvr_free_list.h   |  185 +
 drivers/gpu/drm/imagination/pvr_fw.c          | 1107 +++
 drivers/gpu/drm/imagination/pvr_fw.h          |  345 +
 drivers/gpu/drm/imagination/pvr_fw_info.h     |  115 +
 drivers/gpu/drm/imagination/pvr_fw_meta.c     |  598 ++
 drivers/gpu/drm/imagination/pvr_fw_meta.h     |   14 +
 drivers/gpu/drm/imagination/pvr_fw_mips.c     |  276 +
 drivers/gpu/drm/imagination/pvr_fw_mips.h     |   38 +
 .../gpu/drm/imagination/pvr_fw_startstop.c    |  279 +
 .../gpu/drm/imagination/pvr_fw_startstop.h    |   13 +
 drivers/gpu/drm/imagination/pvr_fw_trace.c    |  505 ++
 drivers/gpu/drm/imagination/pvr_fw_trace.h    |   78 +
 drivers/gpu/drm/imagination/pvr_gem.c         | 1122 +++
 drivers/gpu/drm/imagination/pvr_gem.h         |  386 +
 drivers/gpu/drm/imagination/pvr_hwrt.c        |  551 ++
 drivers/gpu/drm/imagination/pvr_hwrt.h        |  163 +
 drivers/gpu/drm/imagination/pvr_job.c         | 1096 +++
 drivers/gpu/drm/imagination/pvr_job.h         |  116 +
 drivers/gpu/drm/imagination/pvr_params.c      |  147 +
 drivers/gpu/drm/imagination/pvr_params.h      |   72 +
 drivers/gpu/drm/imagination/pvr_power.c       |  196 +
 drivers/gpu/drm/imagination/pvr_power.h       |   37 +
 .../gpu/drm/imagination/pvr_rogue_cr_defs.h   | 6193 +++++++++++++++++
 .../imagination/pvr_rogue_cr_defs_client.h    |  160 +
 drivers/gpu/drm/imagination/pvr_rogue_defs.h  |  179 +
 drivers/gpu/drm/imagination/pvr_rogue_fwif.h  | 2271 ++++++
 .../drm/imagination/pvr_rogue_fwif_check.h    |  491 ++
 .../drm/imagination/pvr_rogue_fwif_client.h   |  369 +
 .../imagination/pvr_rogue_fwif_client_check.h |  133 +
 .../drm/imagination/pvr_rogue_fwif_common.h   |   60 +
 .../pvr_rogue_fwif_resetframework.h           |   29 +
 .../gpu/drm/imagination/pvr_rogue_fwif_sf.h   |  890 +++
 .../drm/imagination/pvr_rogue_fwif_shared.h   |  258 +
 .../imagination/pvr_rogue_fwif_shared_check.h |  107 +
 .../drm/imagination/pvr_rogue_fwif_stream.h   |   78 +
 .../drm/imagination/pvr_rogue_heap_config.h   |  113 +
 drivers/gpu/drm/imagination/pvr_rogue_meta.h  |  356 +
 drivers/gpu/drm/imagination/pvr_rogue_mips.h  |  335 +
 .../drm/imagination/pvr_rogue_mips_check.h    |   56 +
 .../gpu/drm/imagination/pvr_rogue_mmu_defs.h  |  136 +
 drivers/gpu/drm/imagination/pvr_stream.c      |  321 +
 drivers/gpu/drm/imagination/pvr_stream.h      |   74 +
 drivers/gpu/drm/imagination/pvr_stream_defs.c |  270 +
 drivers/gpu/drm/imagination/pvr_stream_defs.h |   14 +
 drivers/gpu/drm/imagination/pvr_vendor.h      |   77 +
 drivers/gpu/drm/imagination/pvr_vm.c          | 3811 ++++++++++
 drivers/gpu/drm/imagination/pvr_vm.h          |   99 +
 drivers/gpu/drm/imagination/pvr_vm_mips.c     |  223 +
 drivers/gpu/drm/imagination/pvr_vm_mips.h     |   22 +
 .../gpu/drm/imagination/vendor/pvr_mt8173.c   |  121 +
 include/uapi/drm/pvr_drm.h                    | 1502 ++++
 71 files changed, 33724 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpu/img,powervr.yaml
 create mode 100644 drivers/gpu/drm/imagination/Kconfig
 create mode 100644 drivers/gpu/drm/imagination/Makefile
 create mode 100644 drivers/gpu/drm/imagination/pvr_ccb.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_ccb.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_cccb.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_cccb.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_context.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_context.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_debugfs.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_debugfs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_device.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_device.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_drv.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_drv.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_dump.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_dump.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_free_list.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_free_list.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_info.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_meta.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_meta.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_mips.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_mips.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_startstop.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_startstop.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_trace.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_trace.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_gem.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_gem.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_hwrt.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_hwrt.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_job.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_job.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_params.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_params.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_power.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_power.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_cr_defs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_cr_defs_client.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_defs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_check.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_client.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_client_check.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_common.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_resetframework.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_sf.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_shared.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_shared_check.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_stream.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_heap_config.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_meta.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mips.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mips_check.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mmu_defs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_stream.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_stream.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_stream_defs.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_stream_defs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_vendor.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_vm.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_vm.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_vm_mips.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_vm_mips.h
 create mode 100644 drivers/gpu/drm/imagination/vendor/pvr_mt8173.c
 create mode 100644 include/uapi/drm/pvr_drm.h
Signature · 1 line
2.40.0
#1 lore raw

RFC PATCH v2 1/2 drm/imagination: Add initial Imagination Technologies PowerVR driver

---
 drivers/gpu/drm/imagination/Kconfig           |   11 +
 drivers/gpu/drm/imagination/Makefile          |   36 +
 drivers/gpu/drm/imagination/pvr_ccb.c         |  380 +
 drivers/gpu/drm/imagination/pvr_ccb.h         |   51 +
 drivers/gpu/drm/imagination/pvr_cccb.c        |  390 ++
 drivers/gpu/drm/imagination/pvr_cccb.h        |  112 +
 drivers/gpu/drm/imagination/pvr_context.c     | 1428 ++++
 drivers/gpu/drm/imagination/pvr_context.h     |  412 ++
 drivers/gpu/drm/imagination/pvr_debugfs.c     |   53 +
 drivers/gpu/drm/imagination/pvr_debugfs.h     |   29 +
 drivers/gpu/drm/imagination/pvr_device.c      |  762 ++
 drivers/gpu/drm/imagination/pvr_device.h      |  760 ++
 drivers/gpu/drm/imagination/pvr_device_info.c |  223 +
 drivers/gpu/drm/imagination/pvr_device_info.h |  133 +
 drivers/gpu/drm/imagination/pvr_drv.c         | 1634 +++++
 drivers/gpu/drm/imagination/pvr_drv.h         |   89 +
 drivers/gpu/drm/imagination/pvr_dump.c        |  353 +
 drivers/gpu/drm/imagination/pvr_dump.h        |   17 +
 drivers/gpu/drm/imagination/pvr_free_list.c   |  559 ++
 drivers/gpu/drm/imagination/pvr_free_list.h   |  185 +
 drivers/gpu/drm/imagination/pvr_fw.c          | 1107 +++
 drivers/gpu/drm/imagination/pvr_fw.h          |  345 +
 drivers/gpu/drm/imagination/pvr_fw_info.h     |  115 +
 drivers/gpu/drm/imagination/pvr_fw_meta.c     |  598 ++
 drivers/gpu/drm/imagination/pvr_fw_meta.h     |   14 +
 drivers/gpu/drm/imagination/pvr_fw_mips.c     |  276 +
 drivers/gpu/drm/imagination/pvr_fw_mips.h     |   38 +
 .../gpu/drm/imagination/pvr_fw_startstop.c    |  279 +
 .../gpu/drm/imagination/pvr_fw_startstop.h    |   13 +
 drivers/gpu/drm/imagination/pvr_fw_trace.c    |  505 ++
 drivers/gpu/drm/imagination/pvr_fw_trace.h    |   78 +
 drivers/gpu/drm/imagination/pvr_gem.c         | 1122 +++
 drivers/gpu/drm/imagination/pvr_gem.h         |  386 +
 drivers/gpu/drm/imagination/pvr_hwrt.c        |  551 ++
 drivers/gpu/drm/imagination/pvr_hwrt.h        |  163 +
 drivers/gpu/drm/imagination/pvr_job.c         | 1096 +++
 drivers/gpu/drm/imagination/pvr_job.h         |  116 +
 drivers/gpu/drm/imagination/pvr_params.c      |  147 +
 drivers/gpu/drm/imagination/pvr_params.h      |   72 +
 drivers/gpu/drm/imagination/pvr_power.c       |  196 +
 drivers/gpu/drm/imagination/pvr_power.h       |   37 +
 .../gpu/drm/imagination/pvr_rogue_cr_defs.h   | 6193 +++++++++++++++++
 .../imagination/pvr_rogue_cr_defs_client.h    |  160 +
 drivers/gpu/drm/imagination/pvr_rogue_defs.h  |  179 +
 drivers/gpu/drm/imagination/pvr_rogue_fwif.h  | 2271 ++++++
 .../drm/imagination/pvr_rogue_fwif_check.h    |  491 ++
 .../drm/imagination/pvr_rogue_fwif_client.h   |  369 +
 .../imagination/pvr_rogue_fwif_client_check.h |  133 +
 .../drm/imagination/pvr_rogue_fwif_common.h   |   60 +
 .../pvr_rogue_fwif_resetframework.h           |   29 +
 .../gpu/drm/imagination/pvr_rogue_fwif_sf.h   |  890 +++
 .../drm/imagination/pvr_rogue_fwif_shared.h   |  258 +
 .../imagination/pvr_rogue_fwif_shared_check.h |  107 +
 .../drm/imagination/pvr_rogue_fwif_stream.h   |   78 +
 .../drm/imagination/pvr_rogue_heap_config.h   |  113 +
 drivers/gpu/drm/imagination/pvr_rogue_meta.h  |  356 +
 drivers/gpu/drm/imagination/pvr_rogue_mips.h  |  335 +
 .../drm/imagination/pvr_rogue_mips_check.h    |   56 +
 .../gpu/drm/imagination/pvr_rogue_mmu_defs.h  |  136 +
 drivers/gpu/drm/imagination/pvr_stream.c      |  321 +
 drivers/gpu/drm/imagination/pvr_stream.h      |   74 +
 drivers/gpu/drm/imagination/pvr_stream_defs.c |  270 +
 drivers/gpu/drm/imagination/pvr_stream_defs.h |   14 +
 drivers/gpu/drm/imagination/pvr_vendor.h      |   77 +
 drivers/gpu/drm/imagination/pvr_vm.c          | 3811 ++++++++++
 drivers/gpu/drm/imagination/pvr_vm.h          |   99 +
 drivers/gpu/drm/imagination/pvr_vm_mips.c     |  223 +
 drivers/gpu/drm/imagination/pvr_vm_mips.h     |   22 +
 .../gpu/drm/imagination/vendor/pvr_mt8173.c   |  121 +
 include/uapi/drm/pvr_drm.h                    | 1502 ++++
 70 files changed, 33619 insertions(+)
 create mode 100644 drivers/gpu/drm/imagination/Kconfig
 create mode 100644 drivers/gpu/drm/imagination/Makefile
 create mode 100644 drivers/gpu/drm/imagination/pvr_ccb.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_ccb.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_cccb.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_cccb.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_context.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_context.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_debugfs.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_debugfs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_device.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_device.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_drv.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_drv.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_dump.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_dump.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_free_list.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_free_list.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_info.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_meta.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_meta.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_mips.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_mips.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_startstop.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_startstop.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_trace.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_trace.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_gem.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_gem.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_hwrt.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_hwrt.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_job.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_job.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_params.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_params.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_power.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_power.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_cr_defs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_cr_defs_client.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_defs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_check.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_client.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_client_check.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_common.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_resetframework.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_sf.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_shared.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_shared_check.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_stream.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_heap_config.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_meta.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mips.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mips_check.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mmu_defs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_stream.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_stream.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_stream_defs.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_stream_defs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_vendor.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_vm.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_vm.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_vm_mips.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_vm_mips.h
 create mode 100644 drivers/gpu/drm/imagination/vendor/pvr_mt8173.c
 create mode 100644 include/uapi/drm/pvr_drm.h
drivers/gpu/drm/imagination/Kconfig new file +11 -0
new file mode 100644
index 000000000000..83248822d0ed
@@ -0,0 +1,11 @@
+# SPDX-License-Identifier: GPL-2.0 OR MIT
+# Copyright (c) 2022 Imagination Technologies Ltd.
+
+config DRM_POWERVR
+	tristate "Imagination Technologies PowerVR Graphics"
+	depends on ARM64
+	depends on DRM
+	select FW_LOADER
+	help
+	  Choose this option if you have a system that has an Imagination
+	  Technologies PowerVR Rogue GPU.
drivers/gpu/drm/imagination/Makefile new file +36 -0
new file mode 100644
index 000000000000..f3dc71828187
@@ -0,0 +1,36 @@
+# SPDX-License-Identifier: GPL-2.0 OR MIT
+# Copyright (c) 2022 Imagination Technologies Ltd.
+
+subdir-ccflags-y := -I$(srctree)/$(src)
+
+powervr-y := \
+	pvr_ccb.o \
+	pvr_cccb.o \
+	pvr_context.o \
+	pvr_device.o \
+	pvr_device_info.o \
+	pvr_drv.o \
+	pvr_dump.o \
+	pvr_free_list.o \
+	pvr_fw.o \
+	pvr_fw_meta.o \
+	pvr_fw_mips.o \
+	pvr_fw_startstop.o \
+	pvr_fw_trace.o \
+	pvr_gem.o \
+	pvr_hwrt.o \
+	pvr_job.o \
+	pvr_params.o \
+	pvr_power.o \
+	pvr_stream.o \
+	pvr_stream_defs.o \
+	pvr_vm.o \
+	pvr_vm_mips.o
+
+powervr-y += \
+	vendor/pvr_mt8173.o
+
+powervr-$(CONFIG_DEBUG_FS) += \
+	pvr_debugfs.o
+
+obj-$(CONFIG_DRM_POWERVR) += powervr.o
drivers/gpu/drm/imagination/pvr_ccb.c new file +380 -0

380 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_ccb.h new file +51 -0

51 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_cccb.c new file +390 -0

390 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_cccb.h new file +112 -0

112 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_context.c new file +1428 -0

1,428 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_context.h new file +412 -0

412 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_debugfs.c new file +53 -0

53 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_debugfs.h new file +29 -0
new file mode 100644
index 000000000000..adf2f7d7a0a9
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0 OR MIT */
+/* Copyright (c) 2022 Imagination Technologies Ltd. */
+
+#ifndef __PVR_DEBUGFS_H__
+#define __PVR_DEBUGFS_H__
+
+/* Forward declaration from <drm/drm_drv.h>. */
+struct drm_minor;
+
+#if defined(CONFIG_DEBUG_FS)
+/* Forward declaration from "pvr_device.h". */
+struct pvr_device;
+
+/* Forward declaration from <linux/dcache.h>. */
+struct dentry;
+
+struct pvr_debugfs_entry {
+	const char *name;
+	void (*init)(struct pvr_device *pvr_dev, struct dentry *dir);
+};
+
+void pvr_debugfs_init(struct drm_minor *minor);
+#else /* defined(CONFIG_DEBUG_FS) */
+#include <linux/compiler_attributes.h>
+
+static __always_inline void pvr_debugfs_init(struct drm_minor *minor) {}
+#endif /* defined(CONFIG_DEBUG_FS) */
+
+#endif /* __PVR_DEBUGFS_H__ */
drivers/gpu/drm/imagination/pvr_device.c new file +762 -0

98 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_device.h new file +760 -0

760 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_device_info.c new file +223 -0

223 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_device_info.h new file +133 -0

133 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_drv.c new file +1634 -0

1,634 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_drv.h new file +89 -0

89 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_dump.c new file +353 -0

353 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_dump.h new file +17 -0
new file mode 100644
index 000000000000..75714aff0a5d

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/imagination/pvr_free_list.c new file +559 -0

559 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_free_list.h new file +185 -0

185 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_fw.c new file +1107 -0

1,107 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_fw.h new file +345 -0

345 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_fw_info.h new file +115 -0

115 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_fw_meta.c new file +598 -0

598 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_fw_meta.h new file +14 -0
new file mode 100644
index 000000000000..5caeb8a4ff61

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/imagination/pvr_fw_mips.c new file +276 -0

276 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_fw_mips.h new file +38 -0
new file mode 100644
index 000000000000..d5db00a9aacf

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/imagination/pvr_fw_startstop.c new file +279 -0

279 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_fw_startstop.h new file +13 -0
new file mode 100644
index 000000000000..3607789c9605

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/imagination/pvr_fw_trace.c new file +505 -0

505 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_fw_trace.h new file +78 -0

78 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_gem.c new file +1122 -0

1,122 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_gem.h new file +386 -0

386 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_hwrt.c new file +551 -0

551 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_hwrt.h new file +163 -0

163 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_job.c new file +1096 -0

1,096 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_job.h new file +116 -0

116 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_params.c new file +147 -0

147 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_params.h new file +72 -0

72 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_power.c new file +196 -0

196 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_power.h new file +37 -0
new file mode 100644
index 000000000000..44042cb4323c

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/imagination/pvr_rogue_cr_defs.h new file +6193 -0

6,193 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_cr_defs_client.h new file +160 -0

160 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_defs.h new file +179 -0

179 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_fwif.h new file +2271 -0

2,271 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_fwif_check.h new file +491 -0

491 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_fwif_client.h new file +369 -0

369 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_fwif_client_check.h new file +133 -0

133 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_fwif_common.h new file +60 -0

60 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_fwif_resetframework.h new file +29 -0
new file mode 100644
index 000000000000..3e161827e150

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/imagination/pvr_rogue_fwif_sf.h new file +890 -0

890 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_fwif_shared.h new file +258 -0

258 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_fwif_shared_check.h new file +107 -0

107 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_fwif_stream.h new file +78 -0

78 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_heap_config.h new file +113 -0

113 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_meta.h new file +356 -0

356 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_mips.h new file +335 -0

335 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_mips_check.h new file +56 -0

56 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_rogue_mmu_defs.h new file +136 -0

136 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_stream.c new file +321 -0

321 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_stream.h new file +74 -0

74 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_stream_defs.c new file +270 -0

270 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_stream_defs.h new file +14 -0
new file mode 100644
index 000000000000..4ddd2912f0d6

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/imagination/pvr_vendor.h new file +77 -0

77 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_vm.c new file +3811 -0

3,811 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_vm.h new file +99 -0

99 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_vm_mips.c new file +223 -0

223 lines not on this page · raw message

drivers/gpu/drm/imagination/pvr_vm_mips.h new file +22 -0
new file mode 100644
index 000000000000..8d0926052520

Lines of this file are not shown. View the raw message.

drivers/gpu/drm/imagination/vendor/pvr_mt8173.c new file +121 -0

121 lines not on this page · raw message

include/uapi/drm/pvr_drm.h new file +1502 -0

1,502 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.40.0

Part of the diff is not shown here. View the raw message.

#3 lore raw

RFC PATCH v2 2/2 dt-bindings: gpu: Add Imagination Technologies PowerVR GPU

In reply to Sarah Walker
---
 .../devicetree/bindings/gpu/img,powervr.yaml  | 105 ++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpu/img,powervr.yaml
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +105 -0
new file mode 100644
index 000000000000..f722fd1d4e8f
@@ -0,0 +1,105 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR MIT)
+# Copyright (c) 2022 Imagination Technologies Ltd.
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/gpu/img-powervr.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"
+
+title: Imagination Technologies PowerVR GPU
+
+maintainers:
+  - Sarah Walker <[email protected]>
+
+properties:
+  compatible:
+    oneOf:
+      - items:
+          - enum:
+              - mediatek,mt8173-gpu
+          - const: img,powervr-series6xt
+      - items:
+          - enum:
+              - ti,am62-gpu
+          - const: img,powervr-seriesaxe
+
+  reg:
+    minItems: 1
+    maxItems: 1
+
+  clocks:
+    minItems: 1
+    maxItems: 3
+
+  clock-names:
+    items:
+      - const: core_clk
+      - const: mem_clk
+      - const: sys_clk
+
+  interrupts:
+    items:
+      - description: GPU interrupt
+
+  interrupt-names:
+    items:
+      - const: gpu
+
+  power-domains:
+    maxItems: 1
+
+  operating-points-v2: true
+  power-supply: true
+
+  "#cooling-cells":
+    const: 2
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+  - interrupt-names
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: mediatek,mt8173-gpu
+    then:
+      properties:
+        reg:
+          minItems: 2
+          maxItems: 2
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: img,powervr-series6xt
+    then:
+      properties:
+        clocks:
+          minItems: 3
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    gpu@13000000 {
+        compatible = "mediatek,mt8173-gpu", "img,powervr-series6xt";
+        reg = <0 0x13000000 0 0xffff>, <0 0x13fff000 0 0x1000>;
+        power-domains = <&scpsys MT8173_POWER_DOMAIN_MFG>;
+        power-supply = <&da9211_vgpu_reg>;
+        operating-points-v2 = <&gpu_opp_table>;
+        clocks = <&gpu_ckgen 0>,
+                 <&gpu_ckgen 1>,
+                 <&gpu_ckgen 2>;
+        clock-names = "core_clk",
+                      "mem_clk",
+                      "sys_clk";
+        interrupts = <GIC_SPI 217 IRQ_TYPE_LEVEL_LOW>;
+        interrupt-names = "gpu";
+    };
+
Signature · 1 line
2.40.0
#4 lore raw

Re: [RFC PATCH v2 2/2] dt-bindings: gpu: Add Imagination Technologies PowerVR GPU

Quoted 1 line · Sarah Walker

NAK, multiple problems.

Missing commit msg.

Please use scripts/get_maintainers.pl to get a list of necessary people and lists to CC. It might happen, that command when run on an older kernel, gives you outdated entries. Therefore please be sure you base your patches on recent Linux kernel.

Missing tests - not CCed to proper lists.

Quoted 11 lines
---
 .../devicetree/bindings/gpu/img,powervr.yaml  | 105 ++++++++++++++++++
 1 file changed, 105 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpu/img,powervr.yaml
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +0 -0
new file mode 100644
index 000000000000..f722fd1d4e8f

Documentation/devicetree/bindings/gpu/img,powervr.yaml line 6

Quoted 6 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +6 -0
@@ -0,0 +1,105 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR MIT)
+# Copyright (c) 2022 Imagination Technologies Ltd.
+%YAML 1.2
+---
+$id: "http://devicetree.org/schemas/gpu/img-powervr.yaml#"
+$schema: "http://devicetree.org/meta-schemas/core.yaml#"

Drop quotes.

Quoted 10 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +10 -0
+
+title: Imagination Technologies PowerVR GPU
+
+maintainers:
+  - Sarah Walker <[email protected]>
+
+properties:
+  compatible:
+    oneOf:
+      - items:

Documentation/devicetree/bindings/gpu/img,powervr.yaml line 26

Quoted 10 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +10 -0
+          - enum:
+              - mediatek,mt8173-gpu
+          - const: img,powervr-series6xt
+      - items:
+          - enum:
+              - ti,am62-gpu
+          - const: img,powervr-seriesaxe
+
+  reg:
+    minItems: 1

Drop minItems.

Documentation/devicetree/bindings/gpu/img,powervr.yaml line 37

Quoted 10 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +10 -0
+    maxItems: 1
+
+  clocks:
+    minItems: 1> +    maxItems: 3
+
+  clock-names:
+    items:
+      - const: core_clk
+      - const: mem_clk
+      - const: sys_clk

Drop _clk suffixes.

Documentation/devicetree/bindings/gpu/img,powervr.yaml line 50

Quoted 13 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +13 -0
+
+  interrupts:
+    items:
+      - description: GPU interrupt
+
+  interrupt-names:
+    items:
+      - const: gpu
+
+  power-domains:
+    maxItems: 1
+
+  operating-points-v2: true

No opp-table?

Quoted 23 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +23 -0
+  power-supply: true
+
+  "#cooling-cells":
+    const: 2
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+  - interrupt-names
+
+allOf:
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: mediatek,mt8173-gpu
+    then:
+      properties:
+        reg:
+          minItems: 2

Documentation/devicetree/bindings/gpu/img,powervr.yaml line 83

Quoted 10 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +10 -0
+          maxItems: 2
+  - if:
+      properties:
+        compatible:
+          contains:
+            const: img,powervr-series6xt
+    then:
+      properties:
+        clocks:
+          minItems: 3

This is really not tested... Misisng additionalProperties:false.

Quoted 12 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +12 -0
+
+examples:
+  - |
+    #include <dt-bindings/interrupt-controller/irq.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+
+    gpu@13000000 {
+        compatible = "mediatek,mt8173-gpu", "img,powervr-series6xt";
+        reg = <0 0x13000000 0 0xffff>, <0 0x13fff000 0 0x1000>;
+        power-domains = <&scpsys MT8173_POWER_DOMAIN_MFG>;
+        power-supply = <&da9211_vgpu_reg>;
+        operating-points-v2 = <&gpu_opp_table>;

Documentation/devicetree/bindings/gpu/img,powervr.yaml line 105

Quoted 10 lines
Documentation/devicetree/bindings/gpu/img,powervr.yaml new file +10 -0
+        clocks = <&gpu_ckgen 0>,
+                 <&gpu_ckgen 1>,
+                 <&gpu_ckgen 2>;
+        clock-names = "core_clk",
+                      "mem_clk",
+                      "sys_clk";
+        interrupts = <GIC_SPI 217 IRQ_TYPE_LEVEL_LOW>;
+        interrupt-names = "gpu";
+    };
+

Stray blank line.

Best regards,
Krzysztof

#5 lore raw
In reply to Sarah Walker
Quoted 16 lines · Sarah Walker

This patch adds the initial DRM driver for Imagination Technologies PowerVR GPUs, starting with those based on our Rogue architecture. It's worth pointing out that this is a new driver, written from the ground up, rather than a refactored version of our existing downstream driver (pvrsrvkm).

This new DRM driver supports:
- GEM shmem allocations
- dma-buf / PRIME
- Per-context (device node open) userspace managed virtual address space
- DRM sync objects (binary and timeline)
- Power management suspend / resume
- GPU job submission (geometry, fragment, compute, transfer)
- META firmware processor
- MIPS firmware processor
- Basic GPU hang recovery

Quoted 3 lines

Still to do:
- Document format of job streams and static context state
- GPU hang detection

Please use drm/sched for this. There's a few reasons:

- linux dma_fence rules are extremely strict, there's pretty much zero wiggle room in semantics. Depending upon how your hardware works it should still be possible to at least resolve some of the dma_fence cpu waits into fw waits if you want that (maybe just within a vkDevice, maybe even across processes), but I really don't want 6 different versions of "how to convert fw semaphores into dma_fence and get it subtle wrong" in upstream.

- linux dma_fence is very much a linux desktop (includes cros) concept only. Windows doesn't need this, android doesn't, server hpc (not sure that'll be a thing for pvr?) doesn't need this. Hard-worn experience is that linux desktop absolutely needs to look like windows/android to the gpu or things wont work well enough. If we handle the dma_fence rules in shared software (because it really is just a software construct), then we get dma_fence compat while driving the gpu 100% like anything else would. I haven't checked pvr but some driver teams have been floating insteresting secure fw semaphore plans where you'd kinda get something that looks like a dma_fence, but in the details it's not.

Also the other reason for drm/sched is shared naming and structures. We have a lot of "fw-sched, aimed for vk" drivers in the queue for upstreaming, and if they all invent their complete vendor-specific inhouse concepts, then drivers defacto become unreadable for anyone else. So they need to be infused with at least the shared concepts so that I can git grep drm_sched and find the pieces I want to look at, and not be forced to read the entire driver.

Related to this I think all vk-first drivers should also adopt the under-discussion gpuva/vm_bind/whatever you call it shared concepts. What exactly that looks like is still tbd I think, but again some minimal shared structs/concepts in this space, while retaining all the flexibility drivers need, is called for.

I think aside from these two areas going full hw specific is all fine.

Uapi review is all up to mesa folks imo (and the consensus reached&documented around vm_bind or whatever it's going to be called).

For the driver itself just a few comments:
- you use devm_ already, also using drmm_ is probably a good idea.

- the hand-rolled pvr_gem.c does not look good, I think we're way past the point where drivers hand-rolling entire gem from nothing is ready for upstream.

- I think it would be really good to use the dma_fence signalling critical section annotations (I plan to resend the ones I have for drm/sched so that they're opt-out for current drivers, but not for new ones). From experience you can savely assume you got things wrong without these :-)

Cheers, Daniel

Quoted 190 lines

- Handling for running out of parameter buffer space (this has made progress since RFC v1, but is still incomplete)

Currently our main focus is on our GX6250, AXE-1-16M and BXS-4-64 GPUs. Testing so far has been done using an Acer Chromebook R13 (GX6250 GPU) and a TI SK-AM62 board (AXE-1-16M GPU). An example SK-AM62 development board can be obtained
here: https://beagleboard.org/play

Firmware for the GX6250 and AXE-1-16M can be found here:
https://gitlab.freedesktop.org/frankbinns/linux-firmware/-/tree/powervr

A Vulkan driver that works with our downstream kernel driver has already been merged into Mesa [1][2]. Support for this new DRM driver is being maintained in a draft merge request [3], with the branch located here:
https://gitlab.freedesktop.org/frankbinns/mesa/-/tree/powervr-winsys

The Vulkan driver is progressing towards Vulkan 1.0. We're code complete, and are working towards passing conformance. This is a work in progress, so we're not sharing numbers just yet.

We are still looking at whether any functionality can be replaced with DRM common code. We are still considering drm_sched and the GPU VA manager.

The code in this patch, along with some of its history, can also be found here:
https://gitlab.freedesktop.org/frankbinns/powervr/-/tree/powervr-next

Sending this out now as it felt like a good point to get some feedback.

[1] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15243
[2] https://gitlab.freedesktop.org/mesa/mesa/-/tree/main/src/imagination/vulkan
[3] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15507

v2:
* Redesigned and simplified UAPI based on RFC feedback from XDC 2022
* Support for transfer and partial render jobs
* Support for timeline sync objects

RFC v1: https://lists.freedesktop.org/archives/dri-devel/2022-August/367814.html

Sarah Walker (2):
drm/imagination: Add initial Imagination Technologies PowerVR driver
dt-bindings: gpu: Add Imagination Technologies PowerVR GPU

 .../devicetree/bindings/gpu/img,powervr.yaml  |  105 +
 drivers/gpu/drm/imagination/Kconfig           |   11 +
 drivers/gpu/drm/imagination/Makefile          |   36 +
 drivers/gpu/drm/imagination/pvr_ccb.c         |  380 +
 drivers/gpu/drm/imagination/pvr_ccb.h         |   51 +
 drivers/gpu/drm/imagination/pvr_cccb.c        |  390 ++
 drivers/gpu/drm/imagination/pvr_cccb.h        |  112 +
 drivers/gpu/drm/imagination/pvr_context.c     | 1428 ++++
 drivers/gpu/drm/imagination/pvr_context.h     |  412 ++
 drivers/gpu/drm/imagination/pvr_debugfs.c     |   53 +
 drivers/gpu/drm/imagination/pvr_debugfs.h     |   29 +
 drivers/gpu/drm/imagination/pvr_device.c      |  762 ++
 drivers/gpu/drm/imagination/pvr_device.h      |  760 ++
 drivers/gpu/drm/imagination/pvr_device_info.c |  223 +
 drivers/gpu/drm/imagination/pvr_device_info.h |  133 +
 drivers/gpu/drm/imagination/pvr_drv.c         | 1634 +++++
 drivers/gpu/drm/imagination/pvr_drv.h         |   89 +
 drivers/gpu/drm/imagination/pvr_dump.c        |  353 +
 drivers/gpu/drm/imagination/pvr_dump.h        |   17 +
 drivers/gpu/drm/imagination/pvr_free_list.c   |  559 ++
 drivers/gpu/drm/imagination/pvr_free_list.h   |  185 +
 drivers/gpu/drm/imagination/pvr_fw.c          | 1107 +++
 drivers/gpu/drm/imagination/pvr_fw.h          |  345 +
 drivers/gpu/drm/imagination/pvr_fw_info.h     |  115 +
 drivers/gpu/drm/imagination/pvr_fw_meta.c     |  598 ++
 drivers/gpu/drm/imagination/pvr_fw_meta.h     |   14 +
 drivers/gpu/drm/imagination/pvr_fw_mips.c     |  276 +
 drivers/gpu/drm/imagination/pvr_fw_mips.h     |   38 +
 .../gpu/drm/imagination/pvr_fw_startstop.c    |  279 +
 .../gpu/drm/imagination/pvr_fw_startstop.h    |   13 +
 drivers/gpu/drm/imagination/pvr_fw_trace.c    |  505 ++
 drivers/gpu/drm/imagination/pvr_fw_trace.h    |   78 +
 drivers/gpu/drm/imagination/pvr_gem.c         | 1122 +++
 drivers/gpu/drm/imagination/pvr_gem.h         |  386 +
 drivers/gpu/drm/imagination/pvr_hwrt.c        |  551 ++
 drivers/gpu/drm/imagination/pvr_hwrt.h        |  163 +
 drivers/gpu/drm/imagination/pvr_job.c         | 1096 +++
 drivers/gpu/drm/imagination/pvr_job.h         |  116 +
 drivers/gpu/drm/imagination/pvr_params.c      |  147 +
 drivers/gpu/drm/imagination/pvr_params.h      |   72 +
 drivers/gpu/drm/imagination/pvr_power.c       |  196 +
 drivers/gpu/drm/imagination/pvr_power.h       |   37 +
 .../gpu/drm/imagination/pvr_rogue_cr_defs.h   | 6193 +++++++++++++++++
 .../imagination/pvr_rogue_cr_defs_client.h    |  160 +
 drivers/gpu/drm/imagination/pvr_rogue_defs.h  |  179 +
 drivers/gpu/drm/imagination/pvr_rogue_fwif.h  | 2271 ++++++
 .../drm/imagination/pvr_rogue_fwif_check.h    |  491 ++
 .../drm/imagination/pvr_rogue_fwif_client.h   |  369 +
 .../imagination/pvr_rogue_fwif_client_check.h |  133 +
 .../drm/imagination/pvr_rogue_fwif_common.h   |   60 +
 .../pvr_rogue_fwif_resetframework.h           |   29 +
 .../gpu/drm/imagination/pvr_rogue_fwif_sf.h   |  890 +++
 .../drm/imagination/pvr_rogue_fwif_shared.h   |  258 +
 .../imagination/pvr_rogue_fwif_shared_check.h |  107 +
 .../drm/imagination/pvr_rogue_fwif_stream.h   |   78 +
 .../drm/imagination/pvr_rogue_heap_config.h   |  113 +
 drivers/gpu/drm/imagination/pvr_rogue_meta.h  |  356 +
 drivers/gpu/drm/imagination/pvr_rogue_mips.h  |  335 +
 .../drm/imagination/pvr_rogue_mips_check.h    |   56 +
 .../gpu/drm/imagination/pvr_rogue_mmu_defs.h  |  136 +
 drivers/gpu/drm/imagination/pvr_stream.c      |  321 +
 drivers/gpu/drm/imagination/pvr_stream.h      |   74 +
 drivers/gpu/drm/imagination/pvr_stream_defs.c |  270 +
 drivers/gpu/drm/imagination/pvr_stream_defs.h |   14 +
 drivers/gpu/drm/imagination/pvr_vendor.h      |   77 +
 drivers/gpu/drm/imagination/pvr_vm.c          | 3811 ++++++++++
 drivers/gpu/drm/imagination/pvr_vm.h          |   99 +
 drivers/gpu/drm/imagination/pvr_vm_mips.c     |  223 +
 drivers/gpu/drm/imagination/pvr_vm_mips.h     |   22 +
 .../gpu/drm/imagination/vendor/pvr_mt8173.c   |  121 +
 include/uapi/drm/pvr_drm.h                    | 1502 ++++
 71 files changed, 33724 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/gpu/img,powervr.yaml
 create mode 100644 drivers/gpu/drm/imagination/Kconfig
 create mode 100644 drivers/gpu/drm/imagination/Makefile
 create mode 100644 drivers/gpu/drm/imagination/pvr_ccb.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_ccb.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_cccb.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_cccb.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_context.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_context.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_debugfs.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_debugfs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_device.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_device.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_device_info.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_drv.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_drv.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_dump.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_dump.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_free_list.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_free_list.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_info.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_meta.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_meta.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_mips.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_mips.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_startstop.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_startstop.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_trace.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_fw_trace.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_gem.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_gem.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_hwrt.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_hwrt.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_job.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_job.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_params.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_params.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_power.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_power.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_cr_defs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_cr_defs_client.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_defs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_check.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_client.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_client_check.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_common.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_resetframework.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_sf.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_shared.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_shared_check.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_fwif_stream.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_heap_config.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_meta.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mips.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mips_check.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_rogue_mmu_defs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_stream.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_stream.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_stream_defs.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_stream_defs.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_vendor.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_vm.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_vm.h
 create mode 100644 drivers/gpu/drm/imagination/pvr_vm_mips.c
 create mode 100644 drivers/gpu/drm/imagination/pvr_vm_mips.h
 create mode 100644 drivers/gpu/drm/imagination/vendor/pvr_mt8173.c
 create mode 100644 include/uapi/drm/pvr_drm.h
Signature · 1 line
2.40.0
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch