Commit 95ebcda3 authored by Fernando Pacheco's avatar Fernando Pacheco Committed by Chris Wilson

drm/i915/uc: Rename uC firmware init/fini functions

he uC firmware init function is called during GuC/HuC init early phases.
 Rename to include "_early" and properly reflect which phase we are at.

The uC firmware fini function is cleaning up the state set/created on
firmware fetch. Replace "_fini" with "_cleanup_fetch".

v2: also rename uC fw fini function
Signed-off-by: default avatarFernando Pacheco <fernando.pacheco@intel.com>
Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20190419230015.18121-2-fernando.pacheco@intel.com
parent 267e80ee
...@@ -154,7 +154,7 @@ int intel_guc_init_misc(struct intel_guc *guc) ...@@ -154,7 +154,7 @@ int intel_guc_init_misc(struct intel_guc *guc)
void intel_guc_fini_misc(struct intel_guc *guc) void intel_guc_fini_misc(struct intel_guc *guc)
{ {
intel_uc_fw_fini(&guc->fw); intel_uc_fw_cleanup_fetch(&guc->fw);
guc_fini_wq(guc); guc_fini_wq(guc);
} }
...@@ -221,7 +221,7 @@ int intel_guc_init(struct intel_guc *guc) ...@@ -221,7 +221,7 @@ int intel_guc_init(struct intel_guc *guc)
err_shared: err_shared:
guc_shared_data_destroy(guc); guc_shared_data_destroy(guc);
err_fetch: err_fetch:
intel_uc_fw_fini(&guc->fw); intel_uc_fw_cleanup_fetch(&guc->fw);
return ret; return ret;
} }
...@@ -237,7 +237,7 @@ void intel_guc_fini(struct intel_guc *guc) ...@@ -237,7 +237,7 @@ void intel_guc_fini(struct intel_guc *guc)
intel_guc_ads_destroy(guc); intel_guc_ads_destroy(guc);
intel_guc_log_destroy(&guc->log); intel_guc_log_destroy(&guc->log);
guc_shared_data_destroy(guc); guc_shared_data_destroy(guc);
intel_uc_fw_fini(&guc->fw); intel_uc_fw_cleanup_fetch(&guc->fw);
} }
static u32 guc_ctl_debug_flags(struct intel_guc *guc) static u32 guc_ctl_debug_flags(struct intel_guc *guc)
......
...@@ -90,7 +90,7 @@ void intel_guc_fw_init_early(struct intel_guc *guc) ...@@ -90,7 +90,7 @@ void intel_guc_fw_init_early(struct intel_guc *guc)
{ {
struct intel_uc_fw *guc_fw = &guc->fw; struct intel_uc_fw *guc_fw = &guc->fw;
intel_uc_fw_init(guc_fw, INTEL_UC_FW_TYPE_GUC); intel_uc_fw_init_early(guc_fw, INTEL_UC_FW_TYPE_GUC);
guc_fw_select(guc_fw); guc_fw_select(guc_fw);
} }
......
...@@ -42,7 +42,7 @@ int intel_huc_check_status(struct intel_huc *huc); ...@@ -42,7 +42,7 @@ int intel_huc_check_status(struct intel_huc *huc);
static inline void intel_huc_fini_misc(struct intel_huc *huc) static inline void intel_huc_fini_misc(struct intel_huc *huc)
{ {
intel_uc_fw_fini(&huc->fw); intel_uc_fw_cleanup_fetch(&huc->fw);
} }
static inline int intel_huc_sanitize(struct intel_huc *huc) static inline int intel_huc_sanitize(struct intel_huc *huc)
......
...@@ -89,7 +89,7 @@ void intel_huc_fw_init_early(struct intel_huc *huc) ...@@ -89,7 +89,7 @@ void intel_huc_fw_init_early(struct intel_huc *huc)
{ {
struct intel_uc_fw *huc_fw = &huc->fw; struct intel_uc_fw *huc_fw = &huc->fw;
intel_uc_fw_init(huc_fw, INTEL_UC_FW_TYPE_HUC); intel_uc_fw_init_early(huc_fw, INTEL_UC_FW_TYPE_HUC);
huc_fw_select(huc_fw); huc_fw_select(huc_fw);
} }
......
...@@ -274,13 +274,13 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw, ...@@ -274,13 +274,13 @@ int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
} }
/** /**
* intel_uc_fw_fini - cleanup uC firmware * intel_uc_fw_cleanup_fetch - cleanup uC firmware
* *
* @uc_fw: uC firmware * @uc_fw: uC firmware
* *
* Cleans up uC firmware by releasing the firmware GEM obj. * Cleans up uC firmware by releasing the firmware GEM obj.
*/ */
void intel_uc_fw_fini(struct intel_uc_fw *uc_fw) void intel_uc_fw_cleanup_fetch(struct intel_uc_fw *uc_fw)
{ {
struct drm_i915_gem_object *obj; struct drm_i915_gem_object *obj;
......
...@@ -102,7 +102,8 @@ static inline const char *intel_uc_fw_type_repr(enum intel_uc_fw_type type) ...@@ -102,7 +102,8 @@ static inline const char *intel_uc_fw_type_repr(enum intel_uc_fw_type type)
} }
static inline static inline
void intel_uc_fw_init(struct intel_uc_fw *uc_fw, enum intel_uc_fw_type type) void intel_uc_fw_init_early(struct intel_uc_fw *uc_fw,
enum intel_uc_fw_type type)
{ {
uc_fw->path = NULL; uc_fw->path = NULL;
uc_fw->fetch_status = INTEL_UC_FIRMWARE_NONE; uc_fw->fetch_status = INTEL_UC_FIRMWARE_NONE;
...@@ -144,10 +145,10 @@ static inline u32 intel_uc_fw_get_upload_size(struct intel_uc_fw *uc_fw) ...@@ -144,10 +145,10 @@ static inline u32 intel_uc_fw_get_upload_size(struct intel_uc_fw *uc_fw)
void intel_uc_fw_fetch(struct drm_i915_private *dev_priv, void intel_uc_fw_fetch(struct drm_i915_private *dev_priv,
struct intel_uc_fw *uc_fw); struct intel_uc_fw *uc_fw);
void intel_uc_fw_cleanup_fetch(struct intel_uc_fw *uc_fw);
int intel_uc_fw_upload(struct intel_uc_fw *uc_fw, int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
int (*xfer)(struct intel_uc_fw *uc_fw, int (*xfer)(struct intel_uc_fw *uc_fw,
struct i915_vma *vma)); struct i915_vma *vma));
void intel_uc_fw_fini(struct intel_uc_fw *uc_fw);
void intel_uc_fw_dump(const struct intel_uc_fw *uc_fw, struct drm_printer *p); void intel_uc_fw_dump(const struct intel_uc_fw *uc_fw, struct drm_printer *p);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment