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 - Implicit sync / reservation objects - DRM sync objects - Power management suspend / resume - Render job submission - Compute job submission - META firmware processor - MIPS firmware processor - Basic GPU hang recovery Still to do: - Transfer job submission (needed for Vulkan) - No-op job submission (needed for Vulkan) - Support RISC-V firmware processor - GPU hang detection - Handling for running out of parameter buffer space - DVFS 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). 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've got several APIs left to implement and a bunch that are queued up. We've mainly been running the Sascha Willems 'triangle' example to verify that we've not regressed anything, along with the 'pipelines' example and a simple compute example. We've not yet done a full conformance run, so I don't have any numbers to share just yet. 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 Sarah Walker (1): drm/imagination: Add initial Imagination Technologies PowerVR driver drivers/gpu/drm/Kconfig | 2 + drivers/gpu/drm/Makefile | 1 + drivers/gpu/drm/imagination/Kconfig | 11 + drivers/gpu/drm/imagination/Makefile | 37 + drivers/gpu/drm/imagination/pvr_ccb.c | 348 + drivers/gpu/drm/imagination/pvr_ccb.h | 50 + drivers/gpu/drm/imagination/pvr_cccb.c | 326 + drivers/gpu/drm/imagination/pvr_cccb.h | 103 + drivers/gpu/drm/imagination/pvr_context.c | 607 ++ drivers/gpu/drm/imagination/pvr_context.h | 176 + drivers/gpu/drm/imagination/pvr_debugfs.c | 53 + drivers/gpu/drm/imagination/pvr_debugfs.h | 29 + drivers/gpu/drm/imagination/pvr_device.c | 759 ++ drivers/gpu/drm/imagination/pvr_device.h | 721 ++ drivers/gpu/drm/imagination/pvr_device_info.c | 207 + drivers/gpu/drm/imagination/pvr_device_info.h | 125 + drivers/gpu/drm/imagination/pvr_drv.c | 1118 +++ drivers/gpu/drm/imagination/pvr_drv.h | 19 + drivers/gpu/drm/imagination/pvr_fence.c | 446 ++ drivers/gpu/drm/imagination/pvr_fence.h | 168 + drivers/gpu/drm/imagination/pvr_free_list.c | 407 ++ drivers/gpu/drm/imagination/pvr_free_list.h | 142 + drivers/gpu/drm/imagination/pvr_fw.c | 1028 +++ drivers/gpu/drm/imagination/pvr_fw.h | 329 + drivers/gpu/drm/imagination/pvr_fw_info.h | 106 + drivers/gpu/drm/imagination/pvr_fw_meta.c | 597 ++ 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 | 1082 +++ drivers/gpu/drm/imagination/pvr_gem.h | 374 + drivers/gpu/drm/imagination/pvr_hwrt.c | 548 ++ drivers/gpu/drm/imagination/pvr_hwrt.h | 165 + drivers/gpu/drm/imagination/pvr_job.c | 1208 ++++ drivers/gpu/drm/imagination/pvr_job.h | 34 + drivers/gpu/drm/imagination/pvr_object.c | 221 + drivers/gpu/drm/imagination/pvr_object.h | 60 + 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 | 243 + .../imagination/pvr_rogue_fwif_client_check.h | 104 + .../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 | 69 + .../drm/imagination/pvr_rogue_heap_config.h | 108 + 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 | 303 + drivers/gpu/drm/imagination/pvr_stream.h | 72 + drivers/gpu/drm/imagination/pvr_stream_defs.c | 231 + drivers/gpu/drm/imagination/pvr_stream_defs.h | 13 + drivers/gpu/drm/imagination/pvr_vendor.h | 77 + drivers/gpu/drm/imagination/pvr_vm.c | 4155 +++++++++++ drivers/gpu/drm/imagination/pvr_vm.h | 130 + 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 | 1172 ++++ 74 files changed, 31826 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_fence.c create mode 100644 drivers/gpu/drm/imagination/pvr_fence.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_object.c create mode 100644 drivers/gpu/drm/imagination/pvr_object.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 -- 2.25.1