All of lore.kernel.org
 help / color / mirror / Atom feed
From: <David.Francis@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: David Francis <David.Francis@amd.com>,
	Felix Kuehling <Felix.Kuehling@amd.com>
Subject: [PATCH 3/3] drm/amd/kfd: Add sphinx documentation for amdkfd
Date: Tue, 19 Jul 2022 10:03:38 -0400	[thread overview]
Message-ID: <20220719140338.1644486-4-David.Francis@amd.com> (raw)
In-Reply-To: <20220719140338.1644486-1-David.Francis@amd.com>

From: David Francis <David.Francis@amd.com>

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@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
---
 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


      parent reply	other threads:[~2022-07-19 14:04 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-19 14:03 drm/amd/kfd: AMDKFD Sphinx documentation David.Francis
2022-07-19 14:03 ` [PATCH 1/3] drm/amd/kfd: Update documentation to match kernel standards David.Francis
2022-07-19 14:03 ` [PATCH 2/3] drm/amd/kfd: Add documentation comments to KFD David.Francis
2022-07-19 14:03 ` David.Francis [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220719140338.1644486-4-David.Francis@amd.com \
    --to=david.francis@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.