HuC Loading Patches
Subsystems (2)
cover HuC Loading Patches
The patches add HuC loading support. The driver builds a frame level workload which is stored in the graphics memory. This workload is presented to HuC for processing. The driver, therefore should first determine if the HuC is enabled and also read the huC athentication status bit to determine if HuC was successfully loaded. The GuC is required to authenticate the HuC. The userspace patches that check for a fully loaded HuC firmware and use it can be found at:
https://lists.freedesktop.org/archives/libva/2016-September/004554.html
https://lists.freedesktop.org/archives/libva/2016-September/004555.html
More information regarding the HuC, batch commands that configure the HuC etc can be found at-
https://01.org/sites/default/files/documentation/intel-gfx-prm-osrc-skl-vol02a-commandreference-instructions-huc.pdf
https://www.x.org/docs/intel/CHV/intel-gfx-prm-osrc-chv-bsw-vol10-hevc.pdf
v2: rebased. Changed the code following the review comments.
v3: rebased. Organize code. Move contents of intel_huc.h to intel_uc.h. Update function intel_huc_load(),intel_huc_init() and intel_uc_fw_fetch() to accept dev_priv instead of dev.
v4: rebased. Remove intel_is_huc_valid() since it is called onoly once. Refactor the code to reduce redundency. Remove fiels like uc_dev which are no longer used.
v5: rebased. Beautify the code- remove comments that no longer hold good, add newlines etc.
v6: rebased. Remove further redundency. Correct comments. Replace wait_for with intel_wait_for_register() for optimisation purpose.Make fw_type an enum.
v7: rebased. Rename intel_huc_loader() to intel_huc(). Move intel_guc_auth_huc() from intel_uc.c to intel_huc.c. Add return values to DRM_ERRORs.
Anusha Srivatsa (8):
drm/i915/guc: Make the GuC fw loading helper functions general drm/i915/huc: Unified css_header struct for GuC and HuC drm/i915/huc: Add HuC fw loading support drm/i915/huc: Add BXT HuC Loading Support drm/i915/HuC: Add KBL huC loading Support drm/i915/huc: Add debugfs for HuC loading status check drm/i915/huc: Support HuC authentication drm/i915/get_params: Add HuC status to getparams
drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/i915_debugfs.c | 43 +++- drivers/gpu/drm/i915/i915_drv.c | 10 + drivers/gpu/drm/i915/i915_drv.h | 2 + drivers/gpu/drm/i915/i915_guc_reg.h | 6 + drivers/gpu/drm/i915/i915_guc_submission.c | 4 +- drivers/gpu/drm/i915/intel_guc_fwif.h | 24 +- drivers/gpu/drm/i915/intel_guc_loader.c | 196 +++++++++-------- drivers/gpu/drm/i915/intel_huc.c | 342 +++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uc.h | 60 +++-- include/uapi/drm/i915_drm.h | 1 + 11 files changed, 569 insertions(+), 120 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_huc.c
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/8 drm/i915/guc: Make the GuC fw loading helper functions general
Rename some of the GuC fw loading code to make them more general. We will utilise them for HuC loading as well.
s/intel_guc_fw/intel_uc_fw/g s/GUC_FIRMWARE/INTEL_UC_FIRMWARE/g
Struct intel_guc_fw is renamed to intel_uc_fw. Prefix of tts members, such as 'guc' or 'guc_fw' either is renamed to 'uc' or removed for same purpose.
v2: rebased on top of nightly.
reapplied the search/replace as upstream code as changed.
v3: removed G from messages in shared fw fetch function.
v4: rebased.Updated dev to dev_priv in intel_guc_setup(), guc_fw_getch() and intel_guc_init().
v5: rebased. Remove uint32_t fw_type to patch 2. Add INTEL_ prefix for fields in enum intel_uc_fw_status. Remove uc_dev field since its never used.Rename uc_fw to just fw and guc_fw to fw to avoid redundency.
v6: rebased. Remove sections of code that were commented and no longer required.
v7: rebased. Remove uc_fw_ prefix from path and obj fields in intel_uc_fw struct as suggested by Michal.
v8: rebased. Add declaration of intel_guc_wopcm_size() in this patch instead of patch 3.
--- drivers/gpu/drm/i915/i915_debugfs.c | 12 +-- drivers/gpu/drm/i915/i915_guc_submission.c | 4 +- drivers/gpu/drm/i915/intel_guc_loader.c | 156 ++++++++++++++--------------- drivers/gpu/drm/i915/intel_uc.h | 37 +++---- 4 files changed, 105 insertions(+), 104 deletions(-)
drivers/gpu/drm/i915/i915_debugfs.c +6 -6
@@ -2328,7 +2328,7 @@ static int i915_llc(struct seq_file *m, void *data)static int i915_guc_load_status_info (struct seq_file *m,void *data) {struct drm_i915_private *dev_priv =node_to_i915 (m->private); -struct intel_guc_fw *guc_fw = &dev_priv->guc.guc_fw; +struct intel_uc_fw *guc_fw = &dev_priv->guc.fw;u32 tmp, i;if (!HAS_GUC_UCODE (dev_priv))
@@ -2336,15 +2336,15 @@ static int i915_guc_load_status_info(struct seq_file *m, void *data)seq_printf (m,"GuC firmware status:\n" );seq_printf (m,"\tpath: %s\n" , - guc_fw->guc_fw_path); + guc_fw->path);seq_printf (m,"\tfetch: %s\n" , -intel_guc_fw_status_repr (guc_fw->guc_fw_fetch_status)); +intel_uc_fw_status_repr (guc_fw->fetch_status));seq_printf (m,"\tload: %s\n" , -intel_guc_fw_status_repr (guc_fw->guc_fw_load_status)); +intel_uc_fw_status_repr (guc_fw->load_status));seq_printf (m,"\tversion wanted: %d.%d\n" , - guc_fw->guc_fw_major_wanted, guc_fw->guc_fw_minor_wanted); + guc_fw->major_ver_wanted, guc_fw->minor_ver_wanted);seq_printf (m,"\tversion found: %d.%d\n" , - guc_fw->guc_fw_major_found, guc_fw->guc_fw_minor_found); + guc_fw->major_ver_found, guc_fw->minor_ver_found);seq_printf (m,"\theader: offset is %d; size = %d\n" , guc_fw->header_offset, guc_fw->header_size); seq_printf(m, "\tuCode: offset is %d; size = %d\n",
drivers/gpu/drm/i915/i915_guc_submission.c +2 -2
@@ -1484,7 +1484,7 @@ int intel_guc_suspend(struct drm_i915_private *dev_priv)struct i915_gem_context *ctx;u32 data[3 ]; -if (guc->guc_fw.guc_fw_load_status !=GUC_FIRMWARE_SUCCESS ) +if (guc->fw.load_status !=INTEL_UC_FIRMWARE_SUCCESS )return 0 ;gen9_disable_guc_interrupts (dev_priv);
@@ -1511,7 +1511,7 @@ int intel_guc_resume(struct drm_i915_private *dev_priv)struct i915_gem_context *ctx;u32 data[3 ]; -if (guc->guc_fw.guc_fw_load_status !=GUC_FIRMWARE_SUCCESS ) +if (guc->fw.load_status !=INTEL_UC_FIRMWARE_SUCCESS )return 0 ;if (i915.guc_log_level >=0 )
drivers/gpu/drm/i915/intel_guc_loader.c +78 -78
341 lines not on this page · raw message
drivers/gpu/drm/i915/intel_uc.h +19 -18
@@ -93,28 +93,28 @@ struct i915_guc_client {uint64_t submissions[I915_NUM_ENGINES ]; }; -enum intel_guc_fw_status { -GUC_FIRMWARE_FAIL =-1 , -GUC_FIRMWARE_NONE =0 , -GUC_FIRMWARE_PENDING , -GUC_FIRMWARE_SUCCESS +enum intel_uc_fw_status { +INTEL_UC_FIRMWARE_FAIL =-1 , +INTEL_UC_FIRMWARE_NONE =0 , +INTEL_UC_FIRMWARE_PENDING , +INTEL_UC_FIRMWARE_SUCCESS };/* * This structure encapsulates all the data needed during the process * of fetching, caching, and loading the firmware image into the GuC. */ -struct intel_guc_fw { -const char * guc_fw_path; -size_t guc_fw_size; -struct drm_i915_gem_object * guc_fw_obj; -enum intel_guc_fw_status guc_fw_fetch_status; -enum intel_guc_fw_status guc_fw_load_status; - -uint16_t guc_fw_major_wanted; -uint16_t guc_fw_minor_wanted; -uint16_t guc_fw_major_found; -uint16_t guc_fw_minor_found; +struct intel_uc_fw { +const char *path; +size_t size; +struct drm_i915_gem_object *obj; +enum intel_uc_fw_status fetch_status; +enum intel_uc_fw_status load_status; + +uint16_t major_ver_wanted; +uint16_t minor_ver_wanted; +uint16_t major_ver_found; +uint16_t minor_ver_found;uint32_t header_size;uint32_t header_offset;
@@ -141,7 +141,7 @@ struct intel_guc_log { };struct intel_guc { -struct intel_guc_fw guc_fw; +struct intel_uc_fw fw;struct intel_guc_log log;/* intel_guc_recv interrupt related state */
@@ -182,9 +182,10 @@ int intel_guc_log_control(struct intel_guc *guc, u32 control_val);extern void intel_guc_init (struct drm_i915_private *dev_priv);extern int intel_guc_setup (struct drm_i915_private *dev_priv);extern void intel_guc_fini (struct drm_i915_private *dev_priv); -extern const char *intel_guc_fw_status_repr (enum intel_guc_fw_status status); +extern const char *intel_uc_fw_status_repr (enum intel_uc_fw_status status);extern int intel_guc_suspend (struct drm_i915_private *dev_priv);extern int intel_guc_resume (struct drm_i915_private *dev_priv); +u32 intel_guc_wopcm_size (struct drm_i915_private *dev_priv);/* i915_guc_submission.c */ int i915_guc_submission_init (struct drm_i915_private *dev_priv);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerQuoted 5 lines · Anusha Srivatsa
The patches add HuC loading support. The driver builds a frame level workload which is stored in the graphics memory. This workload is presented to HuC for processing. The driver, therefore should first determine if the HuC is enabled and also read the huC athentication status bit to determine if HuC was successfully loaded. The GuC is required to authenticate the HuC.
Please fix your git send-email workflow to send the patches properly threaded. Thank you.
BR,
Jani.
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Jani Nikula
maintainerQuoted 9 lines · Jani Nikula
Quoted 5 lines · Anusha Srivatsa
The patches add HuC loading support. The driver builds a frame level workload which is stored in the graphics memory. This workload is presented to HuC for processing. The driver, therefore should first determine if the HuC is enabled and also read the huC athentication status bit to determine if HuC was successfully loaded. The GuC is required to authenticate the HuC.
Please fix your git send-email workflow to send the patches properly threaded. Thank you.
And now I finally reached the properly sent series from Saturday. Sorry for the noise.
BR,
Jani.
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx