Skip to contentSkip to conversation

drm/i915: Add microcontrollers documentation section

PATCH Superseded Daniele Ceraolo Spurio 4 participants 12 messages Sep 27, 2019 – Oct 9, 2019

Subsystems (4)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 drm/i915: Add microcontrollers documentation section

To better organize the information, add a microcontrollers section and move/link the GuC, HuC and DMC documentation under it. Also add a small intro.

---
 Documentation/gpu/i915.rst | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
Documentation/gpu/i915.rst +18 -0
index 465779670fd4..f1bae7867045 100644
@@ -415,6 +415,15 @@ Object Tiling IOCTLs
 .. kernel-doc:: drivers/gpu/drm/i915/gem/i915_gem_tiling.c
    :doc: buffer object tiling
 
+Microcontrollers
+================
+
+Starting from gen9, three microcontrollers are available on the HW: the
+graphics microcontroller (GuC), the HEVC/H.265 microcontroller (HuC) and the
+display microcontroller (DMC). The driver is responsible for loading the
+firmwares on the microcontrollers; the GuC and HuC firmwares are transferred
+to WOPCM using the DMA engine, while the DMC firmware is written through MMIO.
+
 WOPCM
 -----
 
@@ -454,6 +463,15 @@ GuC Address Space
 .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.c
    :doc: GuC Address Space
 
+HuC
+---
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c
+   :doc: HuC Firmware
+
+DMC
+---
+See `CSR firmware support for DMC`_
+
 Tracing
 =======
 
Signature · 6 lines
2.23.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/3 drm/i915/guc: improve documentation

Add a short description of what we expect from GuC and some minor improvements to existing documentation. Also remove a comment about a difference between GuC and HuC that is not true anymore.

Cc Michal Wajdeczko <[email protected]>
Cc Matthew Brost <[email protected]>
---
 Documentation/gpu/i915.rst                    | 22 ++++++++++------
 drivers/gpu/drm/i915/gt/uc/intel_guc.c        | 26 +++++++++++++++++--
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c |  6 +++++
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h  |  3 ---
 4 files changed, 44 insertions(+), 13 deletions(-)
Documentation/gpu/i915.rst +14 -8
index f1bae7867045..357e9dfa7de1 100644
@@ -436,12 +436,24 @@ WOPCM Layout
 GuC
 ---
 
-Firmware Layout
-~~~~~~~~~~~~~~~
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.c
+   :doc: GuC
+
+GuC Firmware Layout
+~~~~~~~~~~~~~~~~~~~
 
 .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h
    :doc: Firmware Layout
 
+GuC Memory Management
+~~~~~~~~~~~~~~~~~~~~~
+
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.c
+   :doc: GuC Memory Management
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.c
+   :functions: intel_guc_allocate_vma
+
+
 GuC-specific firmware loader
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -457,12 +469,6 @@ GuC-based command submission
 .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
    :internal:
 
-GuC Address Space
-~~~~~~~~~~~~~~~~~
-
-.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.c
-   :doc: GuC Address Space
-
 HuC
 ---
 .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c
drivers/gpu/drm/i915/gt/uc/intel_guc.c +24 -2
index 249c747e9756..c6f018099fd0 100644
@@ -9,6 +9,22 @@
 #include "intel_guc_submission.h"
 #include "i915_drv.h"
 
+/**
+ * DOC: GuC
+ *
+ * The GuC is a microcontroller inside the GT HW, introduced in gen9. The GuC is
+ * designed to offload some of the functionality usually run on the host driver;
+ * currently the main operations it can take care of are:
+ *
+ * - Authentication of the HuC, which is required to fully enable HuC usage.
+ * - Low latency graphics context scheduling (a.k.a. GuC submission).
+ * - GT Power management.
+ *
+ * The enable_guc module parameter can be used to select which of those
+ * operations to enable within GuC. Note that not all the operations are
+ * supported on all gen9+ platforms.
+ */
+
 static void gen8_guc_raise_irq(struct intel_guc *guc)
 {
 	struct intel_gt *gt = guc_to_gt(guc);
@@ -548,9 +564,15 @@ int intel_guc_resume(struct intel_guc *guc)
 }
 
 /**
- * DOC: GuC Address Space
+ * DOC: GuC Memory Management
  *
- * The layout of GuC address space is shown below:
+ * GuC can't allocate any memory for its own usage, so all the allocations must
+ * be handled by the host driver. GuC accesses the memory via the GGTT, with the
+ * exception of the top and bottom parts of the 4GB address space, which are
+ * instead re-mapped by the GuC HW to memory location of the FW itself (WOPCM)
+ * or other parts of the HW. The driver must take care not to place objects that
+ * the GuC is going to access in these reserved ranges. The layout of the GuC
+ * address space is shown below:
  *
  * ::
  *
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +6 -0
index f325d3dd564f..849a44add424 100644
@@ -29,6 +29,12 @@ enum {
 /**
  * DOC: GuC-based command submission
  *
+ * IMPORTANT NOTE: GuC submission is currently not supported in i915. The GuC
+ * firmware is moving to an updated submission interface and we plan to
+ * turn submission back on when that lands. The below documentation (and related
+ * code) matches the old submission model and will be updated as part of the
+ * upgrade to the new flow.
+ *
  * GuC client:
  * A intel_guc_client refers to a submission path through GuC. Currently, there
  * is only one client, which is charged with all submissions to the GuC. This
drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h +0 -3
index f8f6c91a0df6..029214cdedd5 100644
@@ -39,9 +39,6 @@
  * 3. Length info of each component can be found in header, in dwords.
  * 4. Modulus and exponent key are not required by driver. They may not appear
  *    in fw. So driver will load a truncated firmware in this case.
- *
- * The only difference between GuC and HuC firmwares is how the version
- * information is saved.
  */
 
 struct uc_css_header {
Signature · 6 lines
2.23.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Acked-by on v1 2/3
#2 lore raw

Re: [PATCH 2/3] drm/i915/guc: improve documentation

Hello Daniele,

Quoted 7 lines · Daniele Ceraolo Spurio

Add a short description of what we expect from GuC and some minor improvements to existing documentation. Also remove a comment about a difference between GuC and HuC that is not true anymore.

Cc Michal Wajdeczko <[email protected]>
Cc Matthew Brost <[email protected]>

Anna Karas
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#3 lore raw

Re: [PATCH 2/3] drm/i915/guc: improve documentation

In reply to Daniele Ceraolo Spurio
Quoted 63 lines · Daniele Ceraolo Spurio

Add a short description of what we expect from GuC and some minor improvements to existing documentation. Also remove a comment about a difference between GuC and HuC that is not true anymore.

Cc Michal Wajdeczko <[email protected]>
Cc Matthew Brost <[email protected]>
---
 Documentation/gpu/i915.rst                    | 22 ++++++++++------
 drivers/gpu/drm/i915/gt/uc/intel_guc.c        | 26 +++++++++++++++++--
 .../gpu/drm/i915/gt/uc/intel_guc_submission.c |  6 +++++
 drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h  |  3 ---
 4 files changed, 44 insertions(+), 13 deletions(-)
Documentation/gpu/i915.rst +14 -8
index f1bae7867045..357e9dfa7de1 100644
@@ -436,12 +436,24 @@ WOPCM Layout
 GuC
 ---
 
-Firmware Layout
-~~~~~~~~~~~~~~~
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.c
+   :doc: GuC
+
+GuC Firmware Layout
+~~~~~~~~~~~~~~~~~~~
 
 .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h
    :doc: Firmware Layout
 
+GuC Memory Management
+~~~~~~~~~~~~~~~~~~~~~
+
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.c
+   :doc: GuC Memory Management
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.c
+   :functions: intel_guc_allocate_vma
+
+
 GuC-specific firmware loader
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
@@ -457,12 +469,6 @@ GuC-based command submission
 .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c
    :internal:
 
-GuC Address Space
-~~~~~~~~~~~~~~~~~
-
-.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.c
-   :doc: GuC Address Space
-
 HuC
 ---
 .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c
drivers/gpu/drm/i915/gt/uc/intel_guc.c +0 -0
index 249c747e9756..c6f018099fd0 100644

drivers/gpu/drm/i915/gt/uc/intel_guc.c line 16

Quoted 8 lines
drivers/gpu/drm/i915/gt/uc/intel_guc.c +5 -0
@@ -9,6 +9,22 @@
 #include "intel_guc_submission.h"
 #include "i915_drv.h"
 
+/**
+ * DOC: GuC
+ *
+ * The GuC is a microcontroller inside the GT HW, introduced in gen9. The GuC is
+ * designed to offload some of the functionality usually run on the host driver;

"... functionality usually run on the host driver" -> "... functionality usually performed by the host driver"?

drivers/gpu/drm/i915/gt/uc/intel_guc.c line 25

Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_guc.c +9 -0
+ * currently the main operations it can take care of are:
+ *
+ * - Authentication of the HuC, which is required to fully enable HuC usage.
+ * - Low latency graphics context scheduling (a.k.a. GuC submission).
+ * - GT Power management.
+ *
+ * The enable_guc module parameter can be used to select which of those
+ * operations to enable within GuC. Note that not all the operations are
+ * supported on all gen9+ platforms.

It would be good to say that the FW is optional and that we support running without it. Also, it would be good to explain what is lost when not using this FW (for now, only losing the ability to use the HuC).

Quoted 10 lines
drivers/gpu/drm/i915/gt/uc/intel_guc.c +2 -1
+ */
+
 static void gen8_guc_raise_irq(struct intel_guc *guc)
 {
 	struct intel_gt *gt = guc_to_gt(guc);
@@ -548,9 +564,15 @@ int intel_guc_resume(struct intel_guc *guc)
 }
 
 /**
- * DOC: GuC Address Space

drivers/gpu/drm/i915/gt/uc/intel_guc.c int intel_guc_resume(struct intel_guc *guc) · line 575

Quoted 10 lines
drivers/gpu/drm/i915/gt/uc/intel_guc.c +8 -1
+ * DOC: GuC Memory Management
  *
- * The layout of GuC address space is shown below:
+ * GuC can't allocate any memory for its own usage, so all the allocations must
+ * be handled by the host driver. GuC accesses the memory via the GGTT, with the
+ * exception of the top and bottom parts of the 4GB address space, which are
+ * instead re-mapped by the GuC HW to memory location of the FW itself (WOPCM)
+ * or other parts of the HW. The driver must take care not to place objects that
+ * the GuC is going to access in these reserved ranges. The layout of the GuC
+ * address space is shown below:

Thanks for writing this! This is really beneficial!

Quoted 8 lines
drivers/gpu/drm/i915/gt/uc/intel_guc.c +0 -0
  *
  * ::
  *
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +0 -0
index f325d3dd564f..849a44add424 100644

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c enum { · line 36

Quoted 8 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +5 -0
@@ -29,6 +29,12 @@ enum {
 /**
  * DOC: GuC-based command submission
  *
+ * IMPORTANT NOTE: GuC submission is currently not supported in i915. The GuC
+ * firmware is moving to an updated submission interface and we plan to
+ * turn submission back on when that lands. The below documentation (and related
+ * code) matches the old submission model and will be updated as part of the
+ * upgrade to the new flow.

Thanks for adding this :)

Quoted 10 lines
drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c +1 -0
+ *
  * GuC client:
  * A intel_guc_client refers to a submission path through GuC. Currently, there
  * is only one client, which is charged with all submissions to the GuC. This
drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h +0 -0
index f8f6c91a0df6..029214cdedd5 100644

drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h line 44

Quoted 9 lines
drivers/gpu/drm/i915/gt/uc/intel_uc_fw_abi.h +0 -3
@@ -39,9 +39,6 @@
  * 3. Length info of each component can be found in header, in dwords.
  * 4. Modulus and exponent key are not required by driver. They may not appear
  *    in fw. So driver will load a truncated firmware in this case.
- *
- * The only difference between GuC and HuC firmwares is how the version
- * information is saved.
  */
 
 struct uc_css_header {

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw

PATCH 3/3 drm/i915/huc: improve documentation

In reply to Daniele Ceraolo Spurio

Better explain the usage of the microcontroller and what i915 is responsible of. While at it, fix the documentation for the auth function, which doesn't do any pinning anymore.

---
 Documentation/gpu/i915.rst                | 10 ++++++++--
 drivers/gpu/drm/i915/gt/uc/intel_huc.c    | 19 +++++++++++++++----
 drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c | 15 ---------------
 3 files changed, 23 insertions(+), 21 deletions(-)
Documentation/gpu/i915.rst +8 -2
index 357e9dfa7de1..bfb64337db66 100644
@@ -471,8 +471,14 @@ GuC-based command submission
 
 HuC
 ---
-.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c
-   :doc: HuC Firmware
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc.c
+   :doc: HuC
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc.c
+   :functions: intel_huc_auth
+
+HuC Firmware Layout
+~~~~~~~~~~~~~~~~~~~
+The HuC FW layout is the same as the GuC one, see `GuC Firmware Layout`_
 
 DMC
 ---
drivers/gpu/drm/i915/gt/uc/intel_huc.c +15 -4
index d4625c97b4f9..6e10fe898c90 100644
@@ -9,6 +9,18 @@
 #include "intel_huc.h"
 #include "i915_drv.h"
 
+/**
+ * DOC: HuC
+ *
+ * The HuC is a dedicated microcontroller for usage in media HEVC (High
+ * Efficiency Video Coding) operations. Userspace can directly use the firmware
+ * capabilities by adding HuC specific commands to batch buffers.
+ * The kernel driver is only responsible for loading the HuC firmware and
+ * triggering its security authentication, which is performed by the GuC. For
+ * The GuC to correctly perform the authentication, the HuC binary must be
+ * loaded before the GuC one.
+ */
+
 void intel_huc_init_early(struct intel_huc *huc)
 {
 	struct drm_i915_private *i915 = huc_to_gt(huc)->i915;
@@ -118,10 +130,9 @@ void intel_huc_fini(struct intel_huc *huc)
  *
  * Called after HuC and GuC firmware loading during intel_uc_init_hw().
  *
- * This function pins HuC firmware image object into GGTT.
- * Then it invokes GuC action to authenticate passing the offset to RSA
- * signature through intel_guc_auth_huc(). It then waits for 50ms for
- * firmware verification ACK and unpins the object.
+ * This function invokes the GuC action to authenticate the HuC firmware,
+ * passing the offset of the RSA signature to intel_guc_auth_huc(). It then
+ * waits for up to 50ms for firmware verification ACK.
  */
 int intel_huc_auth(struct intel_huc *huc)
 {
drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +0 -15
index 74602487ed67..d654340d4d03 100644
@@ -7,21 +7,6 @@
 #include "intel_huc_fw.h"
 #include "i915_drv.h"
 
-/**
- * DOC: HuC Firmware
- *
- * Motivation:
- * GEN9 introduces a new dedicated firmware for usage in media HEVC (High
- * Efficiency Video Coding) operations. Userspace can use the firmware
- * capabilities by adding HuC specific commands to batch buffers.
- *
- * Implementation:
- * The same firmware loader is used as the GuC. However, the actual
- * loading to HW is deferred until GEM initialization is done.
- *
- * Note that HuC firmware loading must be done before GuC loading.
- */
-
 /**
  * intel_huc_fw_init_early() - initializes HuC firmware struct
  * @huc: intel_huc struct
Signature · 6 lines
2.23.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Acked-by on v1 3/3
#5 lore raw

Re: [PATCH 3/3] drm/i915/huc: improve documentation

Hello Daniele,

Quoted 6 lines · Daniele Ceraolo Spurio

Better explain the usage of the microcontroller and what i915 is responsible of. While at it, fix the documentation for the auth function, which doesn't do any pinning anymore.

Anna Karas
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#6 lore raw

Re: [PATCH 3/3] drm/i915/huc: improve documentation

In reply to Daniele Ceraolo Spurio
Quoted 75 lines · Daniele Ceraolo Spurio

Better explain the usage of the microcontroller and what i915 is responsible of. While at it, fix the documentation for the auth function, which doesn't do any pinning anymore.

---
 Documentation/gpu/i915.rst                | 10 ++++++++--
 drivers/gpu/drm/i915/gt/uc/intel_huc.c    | 19 +++++++++++++++----
 drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c | 15 ---------------
 3 files changed, 23 insertions(+), 21 deletions(-)
Documentation/gpu/i915.rst +8 -2
index 357e9dfa7de1..bfb64337db66 100644
@@ -471,8 +471,14 @@ GuC-based command submission
 
 HuC
 ---
-.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c
-   :doc: HuC Firmware
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc.c
+   :doc: HuC
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc.c
+   :functions: intel_huc_auth
+
+HuC Firmware Layout
+~~~~~~~~~~~~~~~~~~~
+The HuC FW layout is the same as the GuC one, see `GuC Firmware Layout`_
 
 DMC
 ---
drivers/gpu/drm/i915/gt/uc/intel_huc.c +15 -4
index d4625c97b4f9..6e10fe898c90 100644
@@ -9,6 +9,18 @@
 #include "intel_huc.h"
 #include "i915_drv.h"
 
+/**
+ * DOC: HuC
+ *
+ * The HuC is a dedicated microcontroller for usage in media HEVC (High
+ * Efficiency Video Coding) operations. Userspace can directly use the firmware
+ * capabilities by adding HuC specific commands to batch buffers.
+ * The kernel driver is only responsible for loading the HuC firmware and
+ * triggering its security authentication, which is performed by the GuC. For
+ * The GuC to correctly perform the authentication, the HuC binary must be
+ * loaded before the GuC one.
+ */
+
 void intel_huc_init_early(struct intel_huc *huc)
 {
 	struct drm_i915_private *i915 = huc_to_gt(huc)->i915;
@@ -118,10 +130,9 @@ void intel_huc_fini(struct intel_huc *huc)
  *
  * Called after HuC and GuC firmware loading during intel_uc_init_hw().
  *
- * This function pins HuC firmware image object into GGTT.
- * Then it invokes GuC action to authenticate passing the offset to RSA
- * signature through intel_guc_auth_huc(). It then waits for 50ms for
- * firmware verification ACK and unpins the object.
+ * This function invokes the GuC action to authenticate the HuC firmware,
+ * passing the offset of the RSA signature to intel_guc_auth_huc(). It then
+ * waits for up to 50ms for firmware verification ACK.
  */
 int intel_huc_auth(struct intel_huc *huc)
 {
drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +0 -0
index 74602487ed67..d654340d4d03 100644

drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c line 16

Quoted 10 lines
drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +0 -7
@@ -7,21 +7,6 @@
 #include "intel_huc_fw.h"
 #include "i915_drv.h"
 
-/**
- * DOC: HuC Firmware
- *
- * Motivation:
- * GEN9 introduces a new dedicated firmware for usage in media HEVC (High
- * Efficiency Video Coding) operations. Userspace can use the firmware
- * capabilities by adding HuC specific commands to batch buffers.

Having a link to the media driver here that would explain what the HuC enables would be beneficial (we don't want to maintain that).

drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c line 23

Quoted 7 lines
drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +0 -7
- *
- * Implementation:
- * The same firmware loader is used as the GuC. However, the actual
- * loading to HW is deferred until GEM initialization is done.
- *
- * Note that HuC firmware loading must be done before GuC loading.
- */

Could we add a section explaining the access the HuC has to memory, and one stating that the firmware is optional?

Anyways, thanks! The series could be landed as-is already, but a few more additions would be welcomed :)

Martin

drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c line 12

Quoted 5 lines
drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +0 -1
-
 /**
  * intel_huc_fw_init_early() - initializes HuC firmware struct
  * @huc: intel_huc struct

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#7 lore raw

Re: [PATCH 3/3] drm/i915/huc: improve documentation

Quoted 98 lines · Martin Peres
Quoted 75 lines · Daniele Ceraolo Spurio

Better explain the usage of the microcontroller and what i915 is responsible of. While at it, fix the documentation for the auth function, which doesn't do any pinning anymore.

---
  Documentation/gpu/i915.rst                | 10 ++++++++--
  drivers/gpu/drm/i915/gt/uc/intel_huc.c    | 19 +++++++++++++++----
  drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c | 15 ---------------
  3 files changed, 23 insertions(+), 21 deletions(-)
Documentation/gpu/i915.rst +8 -2
index 357e9dfa7de1..bfb64337db66 100644
@@ -471,8 +471,14 @@ GuC-based command submission
 
  HuC
  ---
-.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c
-   :doc: HuC Firmware
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc.c
+   :doc: HuC
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc.c
+   :functions: intel_huc_auth
+
+HuC Firmware Layout
+~~~~~~~~~~~~~~~~~~~
+The HuC FW layout is the same as the GuC one, see `GuC Firmware Layout`_
 
  DMC
  ---
drivers/gpu/drm/i915/gt/uc/intel_huc.c +15 -4
index d4625c97b4f9..6e10fe898c90 100644
@@ -9,6 +9,18 @@
  #include "intel_huc.h"
  #include "i915_drv.h"
 
+/**
+ * DOC: HuC
+ *
+ * The HuC is a dedicated microcontroller for usage in media HEVC (High
+ * Efficiency Video Coding) operations. Userspace can directly use the firmware
+ * capabilities by adding HuC specific commands to batch buffers.
+ * The kernel driver is only responsible for loading the HuC firmware and
+ * triggering its security authentication, which is performed by the GuC. For
+ * The GuC to correctly perform the authentication, the HuC binary must be
+ * loaded before the GuC one.
+ */
+
  void intel_huc_init_early(struct intel_huc *huc)
  {
  	struct drm_i915_private *i915 = huc_to_gt(huc)->i915;
@@ -118,10 +130,9 @@ void intel_huc_fini(struct intel_huc *huc)
   *
   * Called after HuC and GuC firmware loading during intel_uc_init_hw().
   *
- * This function pins HuC firmware image object into GGTT.
- * Then it invokes GuC action to authenticate passing the offset to RSA
- * signature through intel_guc_auth_huc(). It then waits for 50ms for
- * firmware verification ACK and unpins the object.
+ * This function invokes the GuC action to authenticate the HuC firmware,
+ * passing the offset of the RSA signature to intel_guc_auth_huc(). It then
+ * waits for up to 50ms for firmware verification ACK.
   */
  int intel_huc_auth(struct intel_huc *huc)
  {
drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +0 -0
index 74602487ed67..d654340d4d03 100644

drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c line 16

Quoted 10 lines
drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +0 -7
@@ -7,21 +7,6 @@
  #include "intel_huc_fw.h"
  #include "i915_drv.h"
 
-/**
- * DOC: HuC Firmware
- *
- * Motivation:
- * GEN9 introduces a new dedicated firmware for usage in media HEVC (High
- * Efficiency Video Coding) operations. Userspace can use the firmware
- * capabilities by adding HuC specific commands to batch buffers.

Having a link to the media driver here that would explain what the HuC enables would be beneficial (we don't want to maintain that).

drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c line 23

Quoted 7 lines
drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +0 -7
- *
- * Implementation:
- * The same firmware loader is used as the GuC. However, the actual
- * loading to HW is deferred until GEM initialization is done.
- *
- * Note that HuC firmware loading must be done before GuC loading.
- */
Quoted 1 line

Could we add a section explaining the access the HuC has to memory, and

I'll have to follow up with the HuC team to understand how the memory access works because I'm not too familiar with HuC. Are you ok if I address all your other comments for GuC and HuC and add this as a follow up later once I get the info?

Daniele

Quoted 12 lines

one stating that the firmware is optional?

Anyways, thanks! The series could be landed as-is already, but a few more additions would be welcomed :)

Martin

Quoted 5 lines
drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +0 -1
-
  /**
   * intel_huc_fw_init_early() - initializes HuC firmware struct
   * @huc: intel_huc struct

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#8 lore raw

Re: [PATCH 3/3] drm/i915/huc: improve documentation

Quoted 105 lines · Daniele Ceraolo Spurio
Quoted 102 lines · Martin Peres
Quoted 86 lines · Daniele Ceraolo Spurio

Better explain the usage of the microcontroller and what i915 is responsible of. While at it, fix the documentation for the auth function, which doesn't do any pinning anymore.

---
  Documentation/gpu/i915.rst                | 10 ++++++++-- drivers/gpu/drm/i915/gt/uc/intel_huc.c    | 19 +++++++++++++++---- drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c | 15 ---------------

  3 files changed, 23 insertions(+), 21 deletions(-)
Documentation/gpu/i915.rst +0 -0
index 357e9dfa7de1..bfb64337db66 100644
@@ -471,8 +471,14 @@ GuC-based command submission

  HuC
  ---
-.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c -   :doc: HuC Firmware
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc.c +   :doc: HuC
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc.c +   :functions: intel_huc_auth

Documentation/gpu/i915.rst +4 -0
+
+HuC Firmware Layout
+~~~~~~~~~~~~~~~~~~~
+The HuC FW layout is the same as the GuC one, see `GuC Firmware 

Layout`_
  DMC
  ---

drivers/gpu/drm/i915/gt/uc/intel_huc.c +5 -0
index d4625c97b4f9..6e10fe898c90 100644
@@ -9,6 +9,18 @@
   #include "intel_huc.h"
   #include "i915_drv.h"
+/**
+ * DOC: HuC
+ *
+ * The HuC is a dedicated microcontroller for usage in media HEVC (High
+ * Efficiency Video Coding) operations. Userspace can directly use 

the firmware
+ * capabilities by adding HuC specific commands to batch buffers.
+ * The kernel driver is only responsible for loading the HuC firmware and
+ * triggering its security authentication, which is performed by the GuC. For
+ * The GuC to correctly perform the authentication, the HuC binary must be
+ * loaded before the GuC one.
+ */
+
  void intel_huc_init_early(struct intel_huc *huc)
  {
      struct drm_i915_private *i915 = huc_to_gt(huc)->i915;

drivers/gpu/drm/i915/gt/uc/intel_huc.c +2 -4
@@ -118,10 +130,9 @@ void intel_huc_fini(struct intel_huc *huc)
    *
    * Called after HuC and GuC firmware loading during intel_uc_init_hw().
    *
- * This function pins HuC firmware image object into GGTT.
- * Then it invokes GuC action to authenticate passing the offset to RSA
- * signature through intel_guc_auth_huc(). It then waits for 50ms for
- * firmware verification ACK and unpins the object.
+ * This function invokes the GuC action to authenticate the HuC 
 firmware,
+ * passing the offset of the RSA signature to intel_guc_auth_huc(). 

It then
+ * waits for up to 50ms for firmware verification ACK. */
  int intel_huc_auth(struct intel_huc *huc)
  {

drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c +0 -5
index 74602487ed67..d654340d4d03 100644
@@ -7,21 +7,6 @@
   #include "intel_huc_fw.h"
   #include "i915_drv.h"
-/**
- * DOC: HuC Firmware
- *
- * Motivation:
- * GEN9 introduces a new dedicated firmware for usage in media HEVC 
Quoted 3 lines

(High
- * Efficiency Video Coding) operations. Userspace can use the firmware
- * capabilities by adding HuC specific commands to batch buffers.

Having a link to the media driver here that would explain what the HuC enables would be beneficial (we don't want to maintain that).

Quoted 7 lines

- *
- * Implementation:
- * The same firmware loader is used as the GuC. However, the actual
- * loading to HW is deferred until GEM initialization is done.
- *
- * Note that HuC firmware loading must be done before GuC loading.
- */

Quoted 4 lines
Quoted 1 line

Could we add a section explaining the access the HuC has to memory, and

I'll have to follow up with the HuC team to understand how the memory access works because I'm not too familiar with HuC. Are you ok if I address all your other comments for GuC and HuC and add this as a follow up later once I get the info?

Never mind, I found the info I needed (Bspec 48058), so I can do all the changes in one go.

Daniele

Quoted 14 lines

Daniele

Quoted 12 lines

one stating that the firmware is optional?

Anyways, thanks! The series could be landed as-is already, but a few more additions would be welcomed :)

Martin

Quoted 5 lines

-
  /**
   * intel_huc_fw_init_early() - initializes HuC firmware struct
   * @huc: intel_huc struct

Quoted 4 lines

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#9 lore raw

✗ Fi.CI.BAT: failure for series starting with [1/3] drm/i915: Add microcontrollers documentation section

In reply to Daniele Ceraolo Spurio
== Series Details ==

== Series Details ==

Series: series starting with [1/3] drm/i915: Add microcontrollers documentation section
URL : https://patchwork.freedesktop.org/series/67356/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_6973 -> Patchwork_14575
====================================================

Summary
-------

**FAILURE**

Serious unknown changes coming with Patchwork_14575 absolutely need to be verified manually.

If you think the reported changes have nothing to do with the changes introduced in Patchwork_14575, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.

External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14575/index.html

Possible new issues
-------------------

Here are the unknown changes that may have been introduced in Patchwork_14575:

### IGT changes ###

#### Possible regressions ####

* igt@i915_selftest@live_gem_contexts:
- fi-kbl-r: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/fi-kbl-r/igt@i915_selftest@live_gem_contexts.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14575/fi-kbl-r/igt@i915_selftest@live_gem_contexts.html

Known issues
------------

Here are the changes found in Patchwork_14575 that come from known issues:

### IGT changes ###

#### Issues hit ####

* igt@gem_ctx_switch@legacy-render:
- fi-bxt-dsi: [PASS][3] -> [INCOMPLETE][4] ([fdo#103927] / [fdo#111381])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/fi-bxt-dsi/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14575/fi-bxt-dsi/igt@[email protected]

* igt@i915_module_load@reload:
- fi-blb-e6850: [PASS][5] -> [INCOMPLETE][6] ([fdo#107718])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/fi-blb-e6850/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14575/fi-blb-e6850/igt@[email protected]

* igt@kms_chamelium@dp-crc-fast:
- fi-icl-u2: [PASS][7] -> [FAIL][8] ([fdo#109635 ] / [fdo#110387])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/fi-icl-u2/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14575/fi-icl-u2/igt@[email protected]

* igt@kms_chamelium@hdmi-hpd-fast:
- fi-kbl-7500u: [PASS][9] -> [FAIL][10] ([fdo#111045] / [fdo#111096])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/fi-kbl-7500u/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14575/fi-kbl-7500u/igt@[email protected]

* igt@kms_pipe_crc_basic@hang-read-crc-pipe-a:
- fi-icl-u3: [PASS][11] -> [DMESG-WARN][12] ([fdo#107724]) +2 similar issues
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/fi-icl-u3/igt@[email protected]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14575/fi-icl-u3/igt@[email protected]

#### Possible fixes ####

* igt@gem_mmap@basic-small-bo:
- fi-icl-u3: [DMESG-WARN][13] ([fdo#107724]) -> [PASS][14] +1 similar issue
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/fi-icl-u3/igt@[email protected]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14575/fi-icl-u3/igt@[email protected]

{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).

[fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
[fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
[fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
[fdo#109635 ]: https://bugs.freedesktop.org/show_bug.cgi?id=109635
[fdo#110387]: https://bugs.freedesktop.org/show_bug.cgi?id=110387
[fdo#111045]: https://bugs.freedesktop.org/show_bug.cgi?id=111045
[fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
[fdo#111381]: https://bugs.freedesktop.org/show_bug.cgi?id=111381
[fdo#111831]: https://bugs.freedesktop.org/show_bug.cgi?id=111831

Participating hosts (53 -> 45)
------------------------------

Missing (8): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-pnv-d510 fi-icl-y fi-byt-clapper fi-bdw-samus

Build changes
-------------

* CI: CI-20190529 -> None
* Linux: CI_DRM_6973 -> Patchwork_14575

CI-20190529: 20190529
CI_DRM_6973: 7462c58bba0fb6e85bd380591c3fd86e298c0f95 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5206: 5a6c68568def840cd720f18fc66f529a89f84675 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_14575: 61eab783ca84603326cd35cda16c3f4fcb9365ff @ git://anongit.freedesktop.org/gfx-ci/linux

== Linux commits ==

61eab783ca84 drm/i915/huc: improve documentation 1b0401f1da97 drm/i915/guc: improve documentation 46bf0b6b061f drm/i915: Add microcontrollers documentation section

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14575/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Acked-by on v1 1/3
#10 lore raw
In reply to Daniele Ceraolo Spurio

Hello Daniele,

Quoted 6 lines · Daniele Ceraolo Spurio

To better organize the information, add a microcontrollers section and move/link the GuC, HuC and DMC documentation under it. Also add a small intro.

Anna Karas
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/3
#11 lore raw
In reply to Daniele Ceraolo Spurio
Quoted 5 lines · Daniele Ceraolo Spurio

To better organize the information, add a microcontrollers section and move/link the GuC, HuC and DMC documentation under it. Also add a small intro.

Quoted 32 lines
Cc Michal Wajdeczko <[email protected]>
---
 Documentation/gpu/i915.rst | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
Documentation/gpu/i915.rst +11 -0
index 465779670fd4..f1bae7867045 100644
@@ -415,6 +415,15 @@ Object Tiling IOCTLs
 .. kernel-doc:: drivers/gpu/drm/i915/gem/i915_gem_tiling.c
    :doc: buffer object tiling
 
+Microcontrollers
+================
+
+Starting from gen9, three microcontrollers are available on the HW: the
+graphics microcontroller (GuC), the HEVC/H.265 microcontroller (HuC) and the
+display microcontroller (DMC). The driver is responsible for loading the
+firmwares on the microcontrollers; the GuC and HuC firmwares are transferred
+to WOPCM using the DMA engine, while the DMC firmware is written through MMIO.
+
 WOPCM
 -----
 
@@ -454,6 +463,15 @@ GuC Address Space
 .. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_guc.c
    :doc: GuC Address Space
 
+HuC
+---

Documentation/gpu/i915.rst GuC Address Space · line 477

Quoted 10 lines
Documentation/gpu/i915.rst +7 -0
+.. kernel-doc:: drivers/gpu/drm/i915/gt/uc/intel_huc_fw.c
+   :doc: HuC Firmware
+
+DMC
+---
+See `CSR firmware support for DMC`_
+
 Tracing
 =======
 

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx