Skip to contentSkip to conversation

Update xe.rst RFC doc

PATCH New Rodrigo Vivi 2 participants 7 messages Dec 1, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover Update xe.rst RFC doc

Let's move more items from the 'WIP' section to the 'Completed' one.

When Xe was an initial experiment we had written down our goals and promises in this RFC with the goal to work with and contribute back to key common DRM items such as drm_scheduler, gpuvm, drm_exec, and establish documentations and community consensus around other new items like vm_bind async usage and its interaction with userptr and locking primitives and rules, as well as long-running workloads with drm_scheduler, etc. As well as other plans like devcoredump and i915 display re-usage.

We are so thankful for this great community and the great discussions, reviews and cross contributions we got so far on this journey. Thank you all.

Most of this checklist is already completed. We're finalizing some last minute cleanups on the uAPI and will be sharing the first pull request shortly.

Meanwhile, the Display team is also working to finalize the few remaining patches to have a clean re-usage of i915 display. Please notice that this is actually a formal item in this xe.rst RFC, but also it is a non-blocking one.

Hopefully we will be able to align the Display for a common pull request. But with the possibility of 2 separate pull requests, one right after the other.

We're looking forward to moving our work on Xe to the mainline and continuing to evolve drm together towards a better future.

Matthew Brost (1):
drm/doc/rfc: Mark long running workload as complete.

Rodrigo Vivi (4):
drm/doc/rfc: Mark drm_scheduler as completed
drm/doc/rfc: Move Xe 'ASYNC VM_BIND' to the 'completed' section drm/doc/rfc: Move userptr integration and vm_bind to the 'completed'
section
drm/doc/rfc: Xe is using drm_exec, so mark as completed

 Documentation/gpu/rfc/xe.rst | 127 +++++++++++++++++------------------
 1 file changed, 62 insertions(+), 65 deletions(-)
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/5 drm/doc/rfc: Mark long running workload as complete.

From: Matthew Brost <[email protected]>

No DRM scheduler changes required, drivers just return NULL in run_job vfunc.

The rough consensus is that no helper or extra scaffolding is needed around long-running jobs and no further changes to drm-scheduler.

At least for now. Other drivers that currently do long-running workloads have no plat to use drm-scheduler. Besides, the current consensus is that this solution of simply returning NULL to the run_job function should work without extra code duplication or complication.

On top of that, this item was already a non-blocking one for upstreaming Xe, so let's move that to the 'Completed' section and revisit the long-running solution as a community after Xe is integrated in DRM.

---
 Documentation/gpu/rfc/xe.rst | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)
Documentation/gpu/rfc/xe.rst +12 -15
index ceb21219d52e..2a5132327617 100644
@@ -132,21 +132,6 @@ the time comes.
 The DRM GPUVM helpers do not yet include the userptr parts, but discussions
 about implementing them are ongoing.
 
-Long running compute: minimal data structure/scaffolding
---------------------------------------------------------
-The generic scheduler code needs to include the handling of endless compute
-contexts, with the minimal scaffolding for preempt-ctx fences (probably on the
-drm_sched_entity) and making sure drm_scheduler can cope with the lack of job
-completion fence.
-
-The goal is to achieve a consensus ahead of Xe initial pull-request, ideally with
-this minimal drm/scheduler work, if needed, merged to drm-misc in a way that any
-drm driver, including Xe, could re-use and add their own individual needs on top
-in a next stage. However, this should not block the initial merge.
-
-This is a non-blocker item since the driver without the support for the long
-running compute enabled is not a showstopper.
-
 Display integration with i915
 -----------------------------
 In order to share the display code with the i915 driver so that there is maximum
@@ -184,6 +169,18 @@ Xe – uAPI high level overview
 Xe – Pre-Merge Goals - Completed
 ================================
 
+Long running compute: minimal data structure/scaffolding
+--------------------------------------------------------
+The generic scheduler code needs to include the handling of endless compute
+contexts, with the minimal scaffolding for preempt-ctx fences (probably on the
+drm_sched_entity) and making sure drm_scheduler can cope with the lack of job
+completion fence.
+
+The goal is to achieve a consensus ahead of Xe initial pull-request, ideally with
+this minimal drm/scheduler work, if needed, merged to drm-misc in a way that any
+drm driver, including Xe, could re-use and add their own individual needs on top
+in a next stage. However, this should not block the initial merge.
+
 Dev_coredump
 ------------
 
Signature · 1 line
2.43.0
#2 lore raw

PATCH 2/5 drm/doc/rfc: Mark drm_scheduler as completed

In reply to Rodrigo Vivi

Current drm-xe-next doesn't have any drm/scheduler patch that is not already accepted in drm-misc-next. This completed this goal with the consensus of how the drm/scheduler fits to the fw scheduling and the relationship between drm_gpu_scheduler and drm_sched_entity.

---
 Documentation/gpu/rfc/xe.rst | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)
Documentation/gpu/rfc/xe.rst +18 -18
index 2a5132327617..9f3afab6c06a 100644
@@ -70,24 +70,6 @@ When the time comes for Xe, the protection will be lifted on Xe and kept in i915
 Xe – Pre-Merge Goals - Work-in-Progress
 =======================================
 
-Drm_scheduler
--------------
-Xe primarily uses Firmware based scheduling (GuC FW). However, it will use
-drm_scheduler as the scheduler ‘frontend’ for userspace submission in order to
-resolve syncobj and dma-buf implicit sync dependencies. However, drm_scheduler is
-not yet prepared to handle the 1-to-1 relationship between drm_gpu_scheduler and
-drm_sched_entity.
-
-Deeper changes to drm_scheduler should *not* be required to get Xe accepted, but
-some consensus needs to be reached between Xe and other community drivers that
-could also benefit from this work, for coupling FW based/assisted submission such
-as the ARM’s new Mali GPU driver, and others.
-
-As a key measurable result, the patch series introducing Xe itself shall not
-depend on any other patch touching drm_scheduler itself that was not yet merged
-through drm-misc. This, by itself, already includes the reach of an agreement for
-uniform 1 to 1 relationship implementation / usage across drivers.
-
 ASYNC VM_BIND
 -------------
 Although having a common DRM level IOCTL for VM_BIND is not a requirement to get
@@ -169,6 +151,24 @@ Xe – uAPI high level overview
 Xe – Pre-Merge Goals - Completed
 ================================
 
+Drm_scheduler
+-------------
+Xe primarily uses Firmware based scheduling (GuC FW). However, it will use
+drm_scheduler as the scheduler ‘frontend’ for userspace submission in order to
+resolve syncobj and dma-buf implicit sync dependencies. However, drm_scheduler is
+not yet prepared to handle the 1-to-1 relationship between drm_gpu_scheduler and
+drm_sched_entity.
+
+Deeper changes to drm_scheduler should *not* be required to get Xe accepted, but
+some consensus needs to be reached between Xe and other community drivers that
+could also benefit from this work, for coupling FW based/assisted submission such
+as the ARM’s new Mali GPU driver, and others.
+
+As a key measurable result, the patch series introducing Xe itself shall not
+depend on any other patch touching drm_scheduler itself that was not yet merged
+through drm-misc. This, by itself, already includes the reach of an agreement for
+uniform 1 to 1 relationship implementation / usage across drivers.
+
 Long running compute: minimal data structure/scaffolding
 --------------------------------------------------------
 The generic scheduler code needs to include the handling of endless compute
Signature · 1 line
2.43.0
#3 lore raw

PATCH 3/5 drm/doc/rfc: Move Xe 'ASYNC VM_BIND' to the 'completed' section

In reply to Rodrigo Vivi

As already indicated in this block, the consensus was already reached out and documented as:
The ASYNC VM_BIND document </gpu/drm-vm-bind-async>

However this was item was not moved to the completed section. Let's move and clean up the WIP block.

---
 Documentation/gpu/rfc/xe.rst | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)
Documentation/gpu/rfc/xe.rst +12 -12
index 9f3afab6c06a..87dd620aea59 100644
@@ -70,18 +70,6 @@ When the time comes for Xe, the protection will be lifted on Xe and kept in i915
 Xe – Pre-Merge Goals - Work-in-Progress
 =======================================
 
-ASYNC VM_BIND
--------------
-Although having a common DRM level IOCTL for VM_BIND is not a requirement to get
-Xe merged, it is mandatory to have a consensus with other drivers and Mesa.
-It needs to be clear how to handle async VM_BIND and interactions with userspace
-memory fences. Ideally with helper support so people don't get it wrong in all
-possible ways.
-
-As a key measurable result, the benefits of ASYNC VM_BIND and a discussion of
-various flavors, error handling and sample API suggestions are documented in
-:doc:`The ASYNC VM_BIND document </gpu/drm-vm-bind-async>`.
-
 Userptr integration and vm_bind
 -------------------------------
 Different drivers implement different ways of dealing with execution of userptr.
@@ -151,6 +139,18 @@ Xe – uAPI high level overview
 Xe – Pre-Merge Goals - Completed
 ================================
 
+ASYNC VM_BIND
+-------------
+Although having a common DRM level IOCTL for VM_BIND is not a requirement to get
+Xe merged, it is mandatory to have a consensus with other drivers and Mesa.
+It needs to be clear how to handle async VM_BIND and interactions with userspace
+memory fences. Ideally with helper support so people don't get it wrong in all
+possible ways.
+
+As a key measurable result, the benefits of ASYNC VM_BIND and a discussion of
+various flavors, error handling and sample API suggestions are documented in
+:doc:`The ASYNC VM_BIND document </gpu/drm-vm-bind-async>`.
+
 Drm_scheduler
 -------------
 Xe primarily uses Firmware based scheduling (GuC FW). However, it will use
Signature · 1 line
2.43.0
#4 lore raw

PATCH 4/5 drm/doc/rfc: Move userptr integration and vm_bind to the 'completed' section

In reply to Rodrigo Vivi

The must-have part of the documentation was already added to the existing /gpu/drm-vm-bind-async. The other extra discussion around GPUVM helpers are currently active in the community. None of those discussion should block Xe since documentation, specially around locking was completed in a community consensus.

---
 Documentation/gpu/rfc/xe.rst | 64 ++++++++++++++++++------------------
 1 file changed, 32 insertions(+), 32 deletions(-)
Documentation/gpu/rfc/xe.rst +32 -32
index 87dd620aea59..cfff8a59a876 100644
@@ -70,38 +70,6 @@ When the time comes for Xe, the protection will be lifted on Xe and kept in i915
 Xe – Pre-Merge Goals - Work-in-Progress
 =======================================
 
-Userptr integration and vm_bind
--------------------------------
-Different drivers implement different ways of dealing with execution of userptr.
-With multiple drivers currently introducing support to VM_BIND, the goal is to
-aim for a DRM consensus on what’s the best way to have that support. To some
-extent this is already getting addressed itself with the GPUVA where likely the
-userptr will be a GPUVA with a NULL GEM call VM bind directly on the userptr.
-However, there are more aspects around the rules for that and the usage of
-mmu_notifiers, locking and other aspects.
-
-This task here has the goal of introducing a documentation of the basic rules.
-
-The documentation *needs* to first live in this document (API session below) and
-then moved to another more specific document or at Xe level or at DRM level.
-
-Documentation should include:
-
- * The userptr part of the VM_BIND api.
-
- * Locking, including the page-faulting case.
-
- * O(1) complexity under VM_BIND.
-
-The document is now included in the drm documentation :doc:`here </gpu/drm-vm-bind-async>`.
-
-Some parts of userptr like mmu_notifiers should become GPUVA or DRM helpers when
-the second driver supporting VM_BIND+userptr appears. Details to be defined when
-the time comes.
-
-The DRM GPUVM helpers do not yet include the userptr parts, but discussions
-about implementing them are ongoing.
-
 Display integration with i915
 -----------------------------
 In order to share the display code with the i915 driver so that there is maximum
@@ -139,6 +107,38 @@ Xe – uAPI high level overview
 Xe – Pre-Merge Goals - Completed
 ================================
 
+Userptr integration and vm_bind
+-------------------------------
+Different drivers implement different ways of dealing with execution of userptr.
+With multiple drivers currently introducing support to VM_BIND, the goal is to
+aim for a DRM consensus on what’s the best way to have that support. To some
+extent this is already getting addressed itself with the GPUVA where likely the
+userptr will be a GPUVA with a NULL GEM call VM bind directly on the userptr.
+However, there are more aspects around the rules for that and the usage of
+mmu_notifiers, locking and other aspects.
+
+This task here has the goal of introducing a documentation of the basic rules.
+
+The documentation *needs* to first live in this document (API session below) and
+then moved to another more specific document or at Xe level or at DRM level.
+
+Documentation should include:
+
+ * The userptr part of the VM_BIND api.
+
+ * Locking, including the page-faulting case.
+
+ * O(1) complexity under VM_BIND.
+
+The document is now included in the drm documentation :doc:`here </gpu/drm-vm-bind-async>`.
+
+Some parts of userptr like mmu_notifiers should become GPUVA or DRM helpers when
+the second driver supporting VM_BIND+userptr appears. Details to be defined when
+the time comes.
+
+The DRM GPUVM helpers do not yet include the userptr parts, but discussions
+about implementing them are ongoing.
+
 ASYNC VM_BIND
 -------------
 Although having a common DRM level IOCTL for VM_BIND is not a requirement to get
Signature · 1 line
2.43.0
#5 lore raw

PATCH 5/5 drm/doc/rfc: Xe is using drm_exec, so mark as completed

In reply to Rodrigo Vivi

Nothing else to be done on this front from Xe perspective.

---
 Documentation/gpu/rfc/xe.rst | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
Documentation/gpu/rfc/xe.rst +8 -8
index cfff8a59a876..97cf87578f97 100644
@@ -85,6 +85,14 @@ from the first pull request of Xe towards drm-next. The expectation is that when
 both drivers are part of the drm-tip, the introduction of cleaner patches will be
 easier and speed up.
 
+Xe – uAPI high level overview
+=============================
+
+...Warning: To be done in follow up patches after/when/where the main consensus in various items are individually reached.
+
+Xe – Pre-Merge Goals - Completed
+================================
+
 Drm_exec
 --------
 Helper to make dma_resv locking for a big number of buffers is getting removed in
@@ -99,14 +107,6 @@ This item ties into the GPUVA, VM_BIND, and even long-running compute support.
 As a key measurable result, we need to have a community consensus documented in
 this document and the Xe driver prepared for the changes, if necessary.
 
-Xe – uAPI high level overview
-=============================
-
-...Warning: To be done in follow up patches after/when/where the main consensus in various items are individually reached.
-
-Xe – Pre-Merge Goals - Completed
-================================
-
 Userptr integration and vm_bind
 -------------------------------
 Different drivers implement different ways of dealing with execution of userptr.
Signature · 1 line
2.43.0
#6 lore raw

[Intel-xe] ✗ CI.Patch_applied: failure for Update xe.rst RFC doc

In reply to Rodrigo Vivi
== Series Details ==

== Series Details ==

Series: Update xe.rst RFC doc
URL : https://patchwork.freedesktop.org/series/127168/
State : failure

== Summary ==

=== Applying kernel patches on branch 'drm-xe-next' with base: === Base commit: 450234a8c drm/xe/xe2: Add workaround 16020292621 === git am output follows ===
error: patch failed: Documentation/gpu/rfc/xe.rst:132
error: Documentation/gpu/rfc/xe.rst: patch does not apply
hint: Use 'git am --show-current-patch' to see the failed patch
Applying: drm/doc/rfc: Mark long running workload as complete. Patch failed at 0001 drm/doc/rfc: Mark long running workload as complete. When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".