From: David Francis <David.Francis@xxxxxxx> Add a new series of documentation entries in the AMDGPU section describing AMDKFD, the compute driver for AMD GPUs Signed-off-by: David Francis <David.Francis@xxxxxxx> Reviewed-by: Felix Kuehling <Felix.Kuehling@xxxxxxx> --- Documentation/gpu/amdgpu/index.rst | 1 + Documentation/gpu/amdgpu/kfd/index.rst | 14 +++++++++ Documentation/gpu/amdgpu/kfd/interrupts.rst | 19 ++++++++++++ Documentation/gpu/amdgpu/kfd/memory.rst | 33 +++++++++++++++++++++ Documentation/gpu/amdgpu/kfd/queues.rst | 21 +++++++++++++ Documentation/gpu/amdgpu/kfd/topology.rst | 13 ++++++++ 6 files changed, 101 insertions(+) create mode 100644 Documentation/gpu/amdgpu/kfd/index.rst create mode 100644 Documentation/gpu/amdgpu/kfd/interrupts.rst create mode 100644 Documentation/gpu/amdgpu/kfd/memory.rst create mode 100644 Documentation/gpu/amdgpu/kfd/queues.rst create mode 100644 Documentation/gpu/amdgpu/kfd/topology.rst diff --git a/Documentation/gpu/amdgpu/index.rst b/Documentation/gpu/amdgpu/index.rst index a24e1cfa7407..e1152c40d78b 100644 --- a/Documentation/gpu/amdgpu/index.rst +++ b/Documentation/gpu/amdgpu/index.rst @@ -10,6 +10,7 @@ Next (GCN) architecture. module-parameters driver-core display/index + kfd/index xgmi ras thermal diff --git a/Documentation/gpu/amdgpu/kfd/index.rst b/Documentation/gpu/amdgpu/kfd/index.rst new file mode 100644 index 000000000000..c9bfc52c547a --- /dev/null +++ b/Documentation/gpu/amdgpu/kfd/index.rst @@ -0,0 +1,14 @@ +=========================================== +drm/amd/amdkfd - Kernel Fusion Driver (KFD) +=========================================== + +KFD is the non-graphics component of AMDGPU. It allows users to run +their own programs (called compute shaders) on +AMD GPUs, including discrete GPUs, integrated GPUs, and APUs. + +.. toctree:: + + topology.rst + memory.rst + queues.rst + interrupts.rst \ No newline at end of file diff --git a/Documentation/gpu/amdgpu/kfd/interrupts.rst b/Documentation/gpu/amdgpu/kfd/interrupts.rst new file mode 100644 index 000000000000..f59b985ca3f1 --- /dev/null +++ b/Documentation/gpu/amdgpu/kfd/interrupts.rst @@ -0,0 +1,19 @@ +====================== +Interrupts and Signals +====================== + +Signals +------- + +Signals are locations in memory used for communication between CPUs +and GPUs. Uses of signals include indicating that a kernel has completed +and indicating that more scratch memory is rqeuired. + +CPUs and GPUs can poll signals to await their signalling. Processes can also +set up an event, which will trigger a CPU interrupt when a signal arrives. + +Interrupts +---------- + +.. kernel-doc:: drivers/gpu/drm/amd/amdkfd/kfd_interrupt.c + :doc: KFD_Interrupts \ No newline at end of file diff --git a/Documentation/gpu/amdgpu/kfd/memory.rst b/Documentation/gpu/amdgpu/kfd/memory.rst new file mode 100644 index 000000000000..2d6b3724d3fb --- /dev/null +++ b/Documentation/gpu/amdgpu/kfd/memory.rst @@ -0,0 +1,33 @@ +============================= +Memory Allocation and Mapping +============================= + +AMD GPUs contain their own page tables used by the GPU's processors; memory must +be mapped on these page tables before the GPU can access it. The GPUs also +contain VRAM memory of their own, which can be allocated. By mapping memory on +both the CPU and GPU, processes can load data onto or off of the GPU. + +Interface +========= + +.. kernel-doc:: drivers/gpu/drm/amd/amdkfd/kfd_chardev.c + :doc: Memory_Types + +Implementation +============== + +.. kernel-doc:: drivers/gpu/drm/amd/amdkfd/kfd_chardev.c + :doc: Memory_Implementation + +Memory Features +=============== + +.. kernel-doc:: drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c + :doc: Memory_Features + + +ioctls +====== + +.. kernel-doc:: include/uapi/linux/kfd_ioctl.h + :identifiers: kfd_ioctl_alloc_memory_of_gpu_args kfd_ioctl_map_memory_to_gpu_args kfd_ioctl_svm_args kfd_ioctl_set_xnack_mode_args \ No newline at end of file diff --git a/Documentation/gpu/amdgpu/kfd/queues.rst b/Documentation/gpu/amdgpu/kfd/queues.rst new file mode 100644 index 000000000000..dbd18029e0c8 --- /dev/null +++ b/Documentation/gpu/amdgpu/kfd/queues.rst @@ -0,0 +1,21 @@ +=============== +Usermode Queues +=============== + +Queues (HSA queues and DMA queues) are the means by which users may submit +programs to be run on the GPU. Once a queue is set up, users can submit commands +to the hardware through it with no driver involvement. This is different from +the way that graphics shaders are loaded, which involves an ioctl each time. + +Interface +========= + +.. kernel-doc:: drivers/gpu/drm/amd/amdkfd/kfd_queue.c + :doc: Queue_Interface + +Implementation +============== + +.. kernel-doc:: drivers/gpu/drm/amd/amdkfd/kfd_queue.c + :doc: Queue_Implementation + diff --git a/Documentation/gpu/amdgpu/kfd/topology.rst b/Documentation/gpu/amdgpu/kfd/topology.rst new file mode 100644 index 000000000000..309f2d01fed9 --- /dev/null +++ b/Documentation/gpu/amdgpu/kfd/topology.rst @@ -0,0 +1,13 @@ +==================== +AMD Compute Topology +==================== + +.. kernel-doc:: drivers/gpu/drm/amd/amdkfd/kfd_topology.c + :doc: Topology + + +Discovery and Initialization +============================ + +.. kernel-doc:: drivers/gpu/drm/amd/amdkfd/kfd_device.c + :doc: Discovery -- 2.25.1