drm/i915/uc: Start preparing GuC/HuC for reset
Subsystems (2)
PATCH 1/1 drm/i915/uc: Start preparing GuC/HuC for reset
Right after GPU reset there will be a small window of time during which some of GuC/HuC fields will still show state before reset. Let's start to fix that by sanitizing firmware status as we will use it shortly.
--- drivers/gpu/drm/i915/i915_gem.c | 1 + drivers/gpu/drm/i915/intel_guc.h | 5 +++++ drivers/gpu/drm/i915/intel_huc.h | 5 +++++ drivers/gpu/drm/i915/intel_uc.c | 11 +++++++++++ drivers/gpu/drm/i915/intel_uc.h | 1 + drivers/gpu/drm/i915/intel_uc_fw.h | 6 ++++++ 6 files changed, 29 insertions(+)
drivers/gpu/drm/i915/i915_gem.c +1 -0
@@ -2981,6 +2981,7 @@ int i915_gem_reset_prepare(struct drm_i915_private *dev_priv) }i915_gem_revoke_fences (dev_priv); +intel_uc_reset_prepare (dev_priv);return err; }
drivers/gpu/drm/i915/intel_guc.h +5 -0
@@ -132,4 +132,9 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)struct i915_vma *intel_guc_allocate_vma (struct intel_guc *guc,u32 size);u32 intel_guc_wopcm_size (struct drm_i915_private *dev_priv); +static inline void intel_guc_reset_prepare (struct intel_guc *guc) +{ +intel_uc_fw_reset_prepare (&guc->fw); +} +#endif
drivers/gpu/drm/i915/intel_huc.h +5 -0
@@ -38,4 +38,9 @@ struct intel_huc {int intel_huc_init_hw (struct intel_huc *huc);int intel_huc_auth (struct intel_huc *huc); +static inline void intel_huc_reset_prepare (struct intel_huc *huc) +{ +intel_uc_fw_reset_prepare (&huc->fw); +} +#endif
drivers/gpu/drm/i915/intel_uc.c +11 -0
@@ -445,3 +445,14 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv)if (USES_GUC_SUBMISSION (dev_priv))gen9_disable_guc_interrupts (dev_priv); } + +void intel_uc_reset_prepare (struct drm_i915_private *i915) +{ +if (!USES_GUC (i915)) +return ; + +GEM_BUG_ON (!HAS_GUC (i915)); + +intel_huc_reset_prepare (&i915->huc); +intel_guc_reset_prepare (&i915->guc); +}
drivers/gpu/drm/i915/intel_uc.h +1 -0
@@ -39,6 +39,7 @@void intel_uc_fini_hw (struct drm_i915_private *dev_priv);int intel_uc_init (struct drm_i915_private *dev_priv);void intel_uc_fini (struct drm_i915_private *dev_priv); +void intel_uc_reset_prepare (struct drm_i915_private *dev_priv);static inline bool intel_uc_is_using_guc (void ) {
drivers/gpu/drm/i915/intel_uc_fw.h +6 -0
@@ -115,6 +115,12 @@ static inline bool intel_uc_fw_is_selected(struct intel_uc_fw *uc_fw)return uc_fw->path !=NULL ; } +static inline void intel_uc_fw_reset_prepare (struct intel_uc_fw *uc_fw) +{ +if (uc_fw->load_status ==INTEL_UC_FIRMWARE_SUCCESS ) + uc_fw->load_status =INTEL_UC_FIRMWARE_PENDING ; +} +void intel_uc_fw_fetch (struct drm_i915_private *dev_priv,struct intel_uc_fw *uc_fw); int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 35 lines · Michal Wajdeczko
Right after GPU reset there will be a small window of time during which some of GuC/HuC fields will still show state before reset. Let's start to fix that by sanitizing firmware status as we will use it shortly.
Suggested-by Daniele Ceraolo Spurio <[email protected]>Signed-off-by Michal Wajdeczko <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Sagar Arun Kamble <[email protected]>Cc Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/i915_gem.c | 1 + drivers/gpu/drm/i915/intel_guc.h | 5 +++++ drivers/gpu/drm/i915/intel_huc.h | 5 +++++ drivers/gpu/drm/i915/intel_uc.c | 11 +++++++++++ drivers/gpu/drm/i915/intel_uc.h | 1 + drivers/gpu/drm/i915/intel_uc_fw.h | 6 ++++++ 6 files changed, 29 insertions(+)drivers/gpu/drm/i915/i915_gem.c +1
-0@@ -2981,6 +2981,7 @@ int i915_gem_reset_prepare(struct drm_i915_private *dev_priv) }i915_gem_revoke_fences (dev_priv); +intel_uc_reset_prepare (dev_priv);return err; }drivers/gpu/drm/i915/intel_guc.h +0
-0
drivers/gpu/drm/i915/intel_guc.h static inline u32 guc_ggtt_offset(struct i915_vma *vma) · line 136
Quoted 5 lines
drivers/gpu/drm/i915/intel_guc.h +2
-0@@ -132,4 +132,9 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)struct i915_vma *intel_guc_allocate_vma (struct intel_guc *guc,u32 size);u32 intel_guc_wopcm_size (struct drm_i915_private *dev_priv); +static inline void intel_guc_reset_prepare (struct intel_guc *guc) +{
We could also move guc_disable_communication and reset_guc_interrupts here and remove them from intel_uc_init_hw (I'm assuming there is no need to do either of the 2 the first time GuC is loaded).
Patch looks good to me apart from the above note.
Daniele
Quoted 57 lines
drivers/gpu/drm/i915/intel_guc.h +3
-0+ intel_uc_fw_reset_prepare(&guc->fw); +} +#endif drivers/gpu/drm/i915/intel_huc.h +5
-0@@ -38,4 +38,9 @@ struct intel_huc {int intel_huc_init_hw (struct intel_huc *huc);int intel_huc_auth (struct intel_huc *huc); +static inline void intel_huc_reset_prepare (struct intel_huc *huc) +{ +intel_uc_fw_reset_prepare (&huc->fw); +} +#endif drivers/gpu/drm/i915/intel_uc.c +11
-0@@ -445,3 +445,14 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv)if (USES_GUC_SUBMISSION (dev_priv))gen9_disable_guc_interrupts (dev_priv); } + +void intel_uc_reset_prepare (struct drm_i915_private *i915) +{ +if (!USES_GUC (i915)) +return ; + +GEM_BUG_ON (!HAS_GUC (i915)); + +intel_huc_reset_prepare (&i915->huc); +intel_guc_reset_prepare (&i915->guc); +}drivers/gpu/drm/i915/intel_uc.h +1
-0@@ -39,6 +39,7 @@void intel_uc_fini_hw (struct drm_i915_private *dev_priv);int intel_uc_init (struct drm_i915_private *dev_priv);void intel_uc_fini (struct drm_i915_private *dev_priv); +void intel_uc_reset_prepare (struct drm_i915_private *dev_priv);static inline bool intel_uc_is_using_guc (void ) {drivers/gpu/drm/i915/intel_uc_fw.h +0
-0@@ -115,6 +115,12 @@ static inline bool intel_uc_fw_is_selected(struct intel_uc_fw *uc_fw)return uc_fw->path !=NULL ; }
drivers/gpu/drm/i915/intel_uc_fw.h static inline bool intel_uc_fw_is_selected(struct intel_uc_fw *uc_fw) · line 126
Quoted 10 lines
drivers/gpu/drm/i915/intel_uc_fw.h +6
-0+static inline void intel_uc_fw_reset_prepare (struct intel_uc_fw *uc_fw) +{ +if (uc_fw->load_status ==INTEL_UC_FIRMWARE_SUCCESS ) + uc_fw->load_status =INTEL_UC_FIRMWARE_PENDING ; +} +void intel_uc_fw_fetch (struct drm_i915_private *dev_priv,struct intel_uc_fw *uc_fw); int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 36 lines · Daniele Ceraolo Spurio
Quoted 33 lines · Michal Wajdeczko
Right after GPU reset there will be a small window of time during which some of GuC/HuC fields will still show state before reset. Let's start to fix that by sanitizing firmware status as we will use it shortly.
Suggested-by Daniele Ceraolo Spurio <[email protected]>Signed-off-by Michal Wajdeczko <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Sagar Arun Kamble <[email protected]>Cc Chris Wilson <[email protected]>---
drivers/gpu/drm/i915/i915_gem.c | 1 + drivers/gpu/drm/i915/intel_guc.h | 5 +++++ drivers/gpu/drm/i915/intel_huc.h | 5 +++++ drivers/gpu/drm/i915/intel_uc.c | 11 +++++++++++ drivers/gpu/drm/i915/intel_uc.h | 1 +drivers/gpu/drm/i915/intel_uc_fw.h| 6 ++++++6 files changed, 29 insertions(+)drivers/gpu/drm/i915/i915_gem.c +1
-0@@ -2981,6 +2981,7 @@ int i915_gem_reset_prepare(struct drm_i915_private *dev_priv) } i915_gem_revoke_fences(dev_priv); + intel_uc_reset_prepare(dev_priv); return err; }drivers/gpu/drm/i915/intel_guc.h +0
-0
Quoted 8 lines
drivers/gpu/drm/i915/intel_guc.h static inline u32 guc_ggtt_offset(struct i915_vma · line 136
Quoted 6 lines
drivers/gpu/drm/i915/intel_guc.h +2
-0@@ -132,4 +132,9 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma) struct i915_vma *intel_guc_allocate_vma(struct intel_guc *guc, u32 size); u32 intel_guc_wopcm_size(struct drm_i915_private *dev_priv); +static inline void intel_guc_reset_prepare (struct intel_guc *guc) +{We could also move
guc_disable_communicationandreset_guc_interruptshere and remove them fromintel_uc_init_hw(I'm assuming there is no need to do either of the 2 the first time GuC is loaded).
Actually after looking at the flow I think we do still need those in intel_uc_init_hw for when we come out of suspension. we call intel_gpu_reset and not the full i915_reset in gem_sanitize, so reset_prepare is not called. for the same reason uc_fw->load_status will probably be incorrect after resume as well.
Daniele
Quoted 67 lines
Patch looks good to me apart from the above note.
Daniele
Quoted 62 lines
drivers/gpu/drm/i915/intel_guc.h +3
-0+ intel_uc_fw_reset_prepare(&guc->fw); +} + #endifdrivers/gpu/drm/i915/intel_huc.h +5
-0@@ -38,4 +38,9 @@ struct intel_huc { int intel_huc_init_hw(struct intel_huc *huc); int intel_huc_auth(struct intel_huc *huc); +static inline void intel_huc_reset_prepare (struct intel_huc *huc) +{ + intel_uc_fw_reset_prepare(&huc->fw); +} + #endifdrivers/gpu/drm/i915/intel_uc.c +0
-0@@ -445,3 +445,14 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv) if (USES_GUC_SUBMISSION(dev_priv)) gen9_disable_guc_interrupts(dev_priv);}
drivers/gpu/drm/i915/intel_uc.c +11
-0+ +void intel_uc_reset_prepare (struct drm_i915_private *i915) +{ + if (!USES_GUC(i915)) + return; + + GEM_BUG_ON(!HAS_GUC(i915)); + + intel_huc_reset_prepare(&i915->huc); + intel_guc_reset_prepare(&i915->guc); +}drivers/gpu/drm/i915/intel_uc.h +1
-0@@ -39,6 +39,7 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv); int intel_uc_init(struct drm_i915_private *dev_priv); void intel_uc_fini(struct drm_i915_private *dev_priv); +void intel_uc_reset_prepare (struct drm_i915_private *dev_priv); static inline bool intel_uc_is_using_guc(void) {drivers/gpu/drm/i915/intel_uc_fw.h +6
-0@@ -115,6 +115,12 @@ static inline bool intel_uc_fw_is_selected(struct intel_uc_fw *uc_fw) return uc_fw->path != NULL; } +static inline void intel_uc_fw_reset_prepare (struct intel_uc_fw *uc_fw) +{ + if (uc_fw->load_status == INTEL_UC_FIRMWARE_SUCCESS) + uc_fw->load_status = INTEL_UC_FIRMWARE_PENDING; +} +
Quoted 8 lines
drivers/gpu/drm/i915/intel_uc_fw.h static inline bool intel_uc_fw_is_selected(struct intel_uc_fw *uc_fw) · line 126
Quoted 4 lines
drivers/gpu/drm/i915/intel_uc_fw.h +0
-0void intel_uc_fw_fetch(struct drm_i915_private *dev_priv, struct intel_uc_fw *uc_fw); int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,_______________________________________________
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
Quoted 35 lines · Michal Wajdeczko
Right after GPU reset there will be a small window of time during which some of GuC/HuC fields will still show state before reset. Let's start to fix that by sanitizing firmware status as we will use it shortly.
Suggested-by Daniele Ceraolo Spurio <[email protected]>Signed-off-by Michal Wajdeczko <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Sagar Arun Kamble <[email protected]>Cc Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/i915_gem.c | 1 + drivers/gpu/drm/i915/intel_guc.h | 5 +++++ drivers/gpu/drm/i915/intel_huc.h | 5 +++++ drivers/gpu/drm/i915/intel_uc.c | 11 +++++++++++ drivers/gpu/drm/i915/intel_uc.h | 1 + drivers/gpu/drm/i915/intel_uc_fw.h | 6 ++++++ 6 files changed, 29 insertions(+)drivers/gpu/drm/i915/i915_gem.c +1
-0@@ -2981,6 +2981,7 @@ int i915_gem_reset_prepare(struct drm_i915_private *dev_priv) }i915_gem_revoke_fences (dev_priv); +intel_uc_reset_prepare (dev_priv);return err; }drivers/gpu/drm/i915/intel_guc.h +0
-0
drivers/gpu/drm/i915/intel_guc.h static inline u32 guc_ggtt_offset(struct i915_vma *vma) · line 135
Quoted 4 lines
drivers/gpu/drm/i915/intel_guc.h +1
-0@@ -132,4 +132,9 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)struct i915_vma *intel_guc_allocate_vma (struct intel_guc *guc,u32 size);u32 intel_guc_wopcm_size (struct drm_i915_private *dev_priv); +static inline void intel_guc_reset_prepare (struct intel_guc *guc)
Hi,
Would intel_reset_guc_prepare be better?
Here you're preparing the guc for reset, not asking guc to prepare a reset.
For example, we have:intel_guc_reset_engine -> h2g requesting an engine resetintel_reset_guc -> i915 will reset gucgen9_reset_guc_interrupts -> i915 is resetting the iir reg
-Michel
Quoted 10 lines
drivers/gpu/drm/i915/intel_guc.h +4
-0+{ +intel_uc_fw_reset_prepare (&guc->fw); +} +#endif drivers/gpu/drm/i915/intel_huc.h +0
-0
drivers/gpu/drm/i915/intel_huc.h struct intel_huc { · line 41
Quoted 4 lines
drivers/gpu/drm/i915/intel_huc.h +1
-0@@ -38,4 +38,9 @@ struct intel_huc {int intel_huc_init_hw (struct intel_huc *huc);int intel_huc_auth (struct intel_huc *huc); +static inline void intel_huc_reset_prepare (struct intel_huc *huc)
same here (for consistency).
Quoted 44 lines
drivers/gpu/drm/i915/intel_huc.h +4
-0+{ +intel_uc_fw_reset_prepare (&huc->fw); +} +#endif drivers/gpu/drm/i915/intel_uc.c +11
-0@@ -445,3 +445,14 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv)if (USES_GUC_SUBMISSION (dev_priv))gen9_disable_guc_interrupts (dev_priv); } + +void intel_uc_reset_prepare (struct drm_i915_private *i915) +{ +if (!USES_GUC (i915)) +return ; + +GEM_BUG_ON (!HAS_GUC (i915)); + +intel_huc_reset_prepare (&i915->huc); +intel_guc_reset_prepare (&i915->guc); +}drivers/gpu/drm/i915/intel_uc.h +1
-0@@ -39,6 +39,7 @@void intel_uc_fini_hw (struct drm_i915_private *dev_priv);int intel_uc_init (struct drm_i915_private *dev_priv);void intel_uc_fini (struct drm_i915_private *dev_priv); +void intel_uc_reset_prepare (struct drm_i915_private *dev_priv);static inline bool intel_uc_is_using_guc (void ) {drivers/gpu/drm/i915/intel_uc_fw.h +0
-0@@ -115,6 +115,12 @@ static inline bool intel_uc_fw_is_selected(struct intel_uc_fw *uc_fw)return uc_fw->path !=NULL ; }
drivers/gpu/drm/i915/intel_uc_fw.h static inline bool intel_uc_fw_is_selected(struct intel_uc_fw *uc_fw) · line 126
Quoted 10 lines
drivers/gpu/drm/i915/intel_uc_fw.h +6
-0+static inline void intel_uc_fw_reset_prepare (struct intel_uc_fw *uc_fw) +{ +if (uc_fw->load_status ==INTEL_UC_FIRMWARE_SUCCESS ) + uc_fw->load_status =INTEL_UC_FIRMWARE_PENDING ; +} +void intel_uc_fw_fetch (struct drm_i915_private *dev_priv,struct intel_uc_fw *uc_fw); int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 42 lines · Michel Thierry
Quoted 33 lines · Michal Wajdeczko
Right after GPU reset there will be a small window of time during which some of GuC/HuC fields will still show state before reset. Let's start to fix that by sanitizing firmware status as we will use it shortly.
Suggested-by Daniele Ceraolo Spurio <[email protected]>Signed-off-by Michal Wajdeczko <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Sagar Arun Kamble <[email protected]>Cc Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/i915_gem.c | 1 + drivers/gpu/drm/i915/intel_guc.h | 5 +++++ drivers/gpu/drm/i915/intel_huc.h | 5 +++++ drivers/gpu/drm/i915/intel_uc.c | 11 +++++++++++ drivers/gpu/drm/i915/intel_uc.h | 1 + drivers/gpu/drm/i915/intel_uc_fw.h | 6 ++++++ 6 files changed, 29 insertions(+)diff --git
a/drivers/gpu/drm/i915/i915_gem.cb/drivers/gpu/drm/i915/i915_gem.c
index 14c855b..9f91625 100644drivers/gpu/drm/i915/i915_gem.c +1
-0@@ -2981,6 +2981,7 @@ int i915_gem_reset_prepare(struct drm_i915_private *dev_priv) }i915_gem_revoke_fences (dev_priv); +intel_uc_reset_prepare (dev_priv);return err; }drivers/gpu/drm/i915/intel_guc.h +0
-0drivers/gpu/drm/i915/intel_guc.h static inline u32 guc_ggtt_offset(struct i915_vma
Quoted 5 lines
drivers/gpu/drm/i915/intel_guc.h +0
-0@@ -132,4 +132,9 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)struct i915_vma *intel_guc_allocate_vma (struct intel_guc *guc,u32 size);u32 intel_guc_wopcm_size (struct drm_i915_private *dev_priv); +static inline void intel_guc_reset_prepare(struct intel_guc *guc)Hi,
Quoted 1 line
Would
intel_reset_guc_preparebe better?
I was following existing naming from "i915_gem_reset_prepare"
But if we want to diverge and still follow obj-verb-subject pattern then maybe something like this:
intel_uc_prepare_to_reset(i915)
{
intel_huc_prepare_to_reset(huc)
intel_guc_prepare_to_reset(guc)
}
/Michal
Quoted 72 lines
Here you're preparing the guc for reset, not asking guc to prepare a reset.
For example, we have:
intel_guc_reset_engine-> h2g requesting an engine resetintel_reset_guc-> i915 will reset gucgen9_reset_guc_interrupts-> i915 is resetting the iir reg-Michel
drivers/gpu/drm/i915/intel_huc.h struct intel_huc { · line 40
Quoted 13 lines
drivers/gpu/drm/i915/intel_guc.h +4
-0+{ +intel_uc_fw_reset_prepare (&guc->fw); +} +#endif drivers/gpu/drm/i915/intel_huc.h +0
-0@@ -38,4 +38,9 @@ struct intel_huc {int intel_huc_init_hw (struct intel_huc *huc);int intel_huc_auth (struct intel_huc *huc); +static inline void intel_huc_reset_prepare(struct intel_huc *huc)same here (for consistency).
Quoted 46 lines
drivers/gpu/drm/i915/intel_huc.h +4
-0+{ +intel_uc_fw_reset_prepare (&huc->fw); +} +#endif drivers/gpu/drm/i915/intel_uc.c +11
-0@@ -445,3 +445,14 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv)if (USES_GUC_SUBMISSION (dev_priv))gen9_disable_guc_interrupts (dev_priv); } + +void intel_uc_reset_prepare (struct drm_i915_private *i915) +{ +if (!USES_GUC (i915)) +return ; + +GEM_BUG_ON (!HAS_GUC (i915)); + +intel_huc_reset_prepare (&i915->huc); +intel_guc_reset_prepare (&i915->guc); +}drivers/gpu/drm/i915/intel_uc.h +1
-0@@ -39,6 +39,7 @@void intel_uc_fini_hw (struct drm_i915_private *dev_priv);int intel_uc_init (struct drm_i915_private *dev_priv);void intel_uc_fini (struct drm_i915_private *dev_priv); +void intel_uc_reset_prepare (struct drm_i915_private *dev_priv);static inline bool intel_uc_is_using_guc (void ) {drivers/gpu/drm/i915/intel_uc_fw.h +0
-0@@ -115,6 +115,12 @@ static inline bool intel_uc_fw_is_selected(struct intel_uc_fw *uc_fw)return uc_fw->path !=NULL ; } +static inline void intel_uc_fw_reset_prepare(struct intel_uc_fw *uc_fw)
Quoted 8 lines
drivers/gpu/drm/i915/intel_uc_fw.h static inline bool intel_uc_fw_is_selected(struct intel_uc_fw *uc_fw) · line 126
Quoted 8 lines
drivers/gpu/drm/i915/intel_uc_fw.h +5
-0+{ +if (uc_fw->load_status ==INTEL_UC_FIRMWARE_SUCCESS ) + uc_fw->load_status =INTEL_UC_FIRMWARE_PENDING ; +} +void intel_uc_fw_fetch (struct drm_i915_private *dev_priv,struct intel_uc_fw *uc_fw); int intel_uc_fw_upload(struct intel_uc_fw *uc_fw,
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 42 lines · Michal Wajdeczko
Quoted 40 lines · Michel Thierry
Quoted 32 lines · Michal Wajdeczko
Right after GPU reset there will be a small window of time during which some of GuC/HuC fields will still show state before reset. Let's start to fix that by sanitizing firmware status as we will use it shortly.
Suggested-by Daniele Ceraolo Spurio <[email protected]>Signed-off-by Michal Wajdeczko <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>Cc Sagar Arun Kamble <[email protected]>Cc Chris Wilson <[email protected]>---
drivers/gpu/drm/i915/i915_gem.c | 1 + drivers/gpu/drm/i915/intel_guc.h | 5 +++++ drivers/gpu/drm/i915/intel_huc.h | 5 +++++ drivers/gpu/drm/i915/intel_uc.c | 11 +++++++++++ drivers/gpu/drm/i915/intel_uc.h | 1 +drivers/gpu/drm/i915/intel_uc_fw.h| 6 ++++++6 files changed, 29 insertions(+)diff --git
a/drivers/gpu/drm/i915/i915_gem.cb/drivers/gpu/drm/i915/i915_gem.cindex 14c855b..9f91625 100644drivers/gpu/drm/i915/i915_gem.c +1
-0@@ -2981,6 +2981,7 @@ int i915_gem_reset_prepare(struct drm_i915_private *dev_priv) } i915_gem_revoke_fences(dev_priv); + intel_uc_reset_prepare(dev_priv); return err; }drivers/gpu/drm/i915/intel_guc.h +0
-0drivers/gpu/drm/i915/intel_guc.h static inline u32 guc_ggtt_offset(struct i915_vma · line 135
Quoted 4 lines
drivers/gpu/drm/i915/intel_guc.h +0
-0@@ -132,4 +132,9 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma) struct i915_vma *intel_guc_allocate_vma(struct intel_guc *guc, u32 size); u32 intel_guc_wopcm_size(struct drm_i915_private *dev_priv); +static inline void intel_guc_reset_prepare(struct intel_guc *guc)Hi,
Quoted 4 lines
Quoted 1 line
Would
intel_reset_guc_preparebe better?I was following existing naming from "
i915_gem_reset_prepare"
Yes, guc is probably the only special one that can be reset or reset something itself...
Quoted 9 lines
But if we want to diverge and still follow obj-verb-subject pattern then maybe something like this:
intel_uc_prepare_to_reset(i915)
{
intel_huc_prepare_to_reset(huc)
intel_guc_prepare_to_reset(guc)
}
This looks clearer to me.
Thanks
Quoted 73 lines
/Michal
Quoted 71 lines
Here you're preparing the guc for reset, not asking guc to prepare a reset.
For example, we have:
intel_guc_reset_engine -> h2g requesting an engine reset intel_reset_guc -> i915 will reset gucgen9_reset_guc_interrupts-> i915 is resetting the iir reg-Michel
drivers/gpu/drm/i915/intel_huc.h struct intel_huc { · line 40
Quoted 13 lines
drivers/gpu/drm/i915/intel_guc.h +4
-0+{ + intel_uc_fw_reset_prepare(&guc->fw); +} +#endif
drivers/gpu/drm/i915/intel_huc.h +0
-0@@ -38,4 +38,9 @@ struct intel_huc { int intel_huc_init_hw(struct intel_huc *huc); int intel_huc_auth(struct intel_huc *huc); +static inline void intel_huc_reset_prepare(struct intel_huc *huc)same here (for consistency).
Quoted 45 lines
drivers/gpu/drm/i915/intel_huc.h +4
-0+{ + intel_uc_fw_reset_prepare(&huc->fw); +} + #endifdrivers/gpu/drm/i915/intel_uc.c +0
-0@@ -445,3 +445,14 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv) if (USES_GUC_SUBMISSION(dev_priv)) gen9_disable_guc_interrupts(dev_priv);}
drivers/gpu/drm/i915/intel_uc.c +11
-0+ +void intel_uc_reset_prepare (struct drm_i915_private *i915) +{ + if (!USES_GUC(i915)) + return; + + GEM_BUG_ON(!HAS_GUC(i915)); + + intel_huc_reset_prepare(&i915->huc); + intel_guc_reset_prepare(&i915->guc); +}drivers/gpu/drm/i915/intel_uc.h +1
-0@@ -39,6 +39,7 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv); int intel_uc_init(struct drm_i915_private *dev_priv); void intel_uc_fini(struct drm_i915_private *dev_priv); +void intel_uc_reset_prepare (struct drm_i915_private *dev_priv); static inline bool intel_uc_is_using_guc(void) {drivers/gpu/drm/i915/intel_uc_fw.h +0
-0@@ -115,6 +115,12 @@ static inline bool intel_uc_fw_is_selected(struct intel_uc_fw *uc_fw) return uc_fw->path != NULL; } +static inline void intel_uc_fw_reset_prepare(struct intel_uc_fw *uc_fw)
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_uc_fw.h +5
-0+{ + if (uc_fw->load_status == INTEL_UC_FIRMWARE_SUCCESS) + uc_fw->load_status = INTEL_UC_FIRMWARE_PENDING; +} + void intel_uc_fw_fetch(struct drm_i915_private *dev_priv, struct intel_uc_fw *uc_fw);int intel_uc_fw_upload(struct
intel_uc_fw*uc_fw,
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx