]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/xe/psmi: Add debugfs interface for PSMI
authorLucas De Marchi <lucas.demarchi@intel.com>
Thu, 21 Aug 2025 16:17:57 +0000 (09:17 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Fri, 22 Aug 2025 18:46:43 +0000 (11:46 -0700)
commitaaa0c1f50a3d3fc1624360eaeb7fe69af62f7107
treeb77448262c77bd540f06e185290ea6ccec68c026
parentefeb036ffd2a0d1c1afba3d74bd5965825d1a646
drm/xe/psmi: Add debugfs interface for PSMI

Requirement for PSMI capture is to have a physically contiguous buffer.
All the needed configuration is done by the userspace tool directly to
the GPU via mmio access.

This interface only support allocating from VRAM regions. For integrated
devices, the PSMI buffer is in SYSTEM memory and should be allocated by
userspace using hugetlbfs.

Here we add the ability to allocate a region of physically contiguous
memory by writing to debugfs file (listed below). For multi-tile devices,
the capture tool requires ability to allocate a capture buffer per tile
(VRAM region) and so user can specify a region_mask. The tool then
can mmap the buffers via direct mmap of the PCIBAR via sysfs.

To support the capture tool, 3 new debugfs entries are added:

   psmi_capture_addr - physical address per VRAM region's capture buffer
   psmi_capture_region_mask - select which region(s) to allocate a buffer
   psmi_capture_size - size of current capture buffer

Writing psmi_capture_size will allocate new buffer of requested size per
region after freeing any current buffers.

Cc: Matt Roper <matthew.d.roper@intel.com>
Cc: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Original-author: Brian Welty <brian.welty@intel.com>
Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com> # v2
Link: https://lore.kernel.org/r/20250821-psmi-v5-2-34ab7550d3d8@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/Makefile
drivers/gpu/drm/xe/xe_debugfs.c
drivers/gpu/drm/xe/xe_device.c
drivers/gpu/drm/xe/xe_device_types.h
drivers/gpu/drm/xe/xe_psmi.c [new file with mode: 0644]
drivers/gpu/drm/xe/xe_psmi.h [new file with mode: 0644]