drm/i915/guc: Export guc_init_send_regs and call only during intel_uc_init_hw
Subsystems (2)
PATCH 1/8 drm/i915/guc: Export guc_init_send_regs and call only during intel_uc_init_hw
s/guc_init_send_regs/intel_guc_init_send_regs.
Added declaration in intel_uc.h. Calling it from intel_uc_init_hw as it is one time setup.
--- drivers/gpu/drm/i915/intel_uc.c | 6 +++--- drivers/gpu/drm/i915/intel_uc.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_uc.c +3 -3
@@ -271,7 +271,7 @@ static inline i915_reg_t guc_send_reg(struct intel_guc *guc, u32 i)return _MMIO (guc->send_regs.base +4 * i); } -static void guc_init_send_regs (struct intel_guc *guc) +void intel_guc_init_send_regs (struct intel_guc *guc) {struct drm_i915_private *dev_priv =guc_to_i915 (guc);enum forcewake_domains fw_domains =0 ;
@@ -309,8 +309,6 @@ static int guc_enable_communication(struct intel_guc *guc) {struct drm_i915_private *dev_priv =guc_to_i915 (guc); -guc_init_send_regs (guc); -if (HAS_GUC_CT (dev_priv))return intel_guc_enable_ct (guc);
@@ -386,6 +384,8 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)if (ret) goto err_log_capture; +intel_guc_init_send_regs (guc); + ret =guc_enable_communication (guc);if (ret) goto err_log_capture;
drivers/gpu/drm/i915/intel_uc.h +1 -0
@@ -211,6 +211,7 @@ struct intel_huc {int intel_guc_sample_forcewake (struct intel_guc *guc);int intel_guc_send_nop (struct intel_guc *guc,const u32 *action,u32 len);int intel_guc_send_mmio (struct intel_guc *guc,const u32 *action,u32 len); +void intel_guc_init_send_regs (struct intel_guc *guc);static inline int intel_guc_send (struct intel_guc *guc,const u32 *action,u32 len) {
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/8 drm/i915/guc: Create intel_guc_init_early
Prepared intel_guc_init_early for GuC Specific early initialization to be done from intel_uc_init_early.
--- drivers/gpu/drm/i915/intel_uc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_uc.c +6 -3
@@ -101,10 +101,8 @@ static void gen8_guc_raise_irq(struct intel_guc *guc)I915_WRITE (GUC_SEND_INTERRUPT ,GUC_SEND_TRIGGER ); } -void intel_uc_init_early (struct drm_i915_private *dev_priv) +static void intel_guc_init_early (struct intel_guc *guc) { -struct intel_guc *guc = &dev_priv->guc; -intel_guc_ct_init_early (&guc->ct);mutex_init (&guc->send_mutex);
@@ -112,6 +110,11 @@ void intel_uc_init_early(struct drm_i915_private *dev_priv) guc->notify = gen8_guc_raise_irq; } +void intel_uc_init_early (struct drm_i915_private *dev_priv) +{ +intel_guc_init_early (&dev_priv->guc); +} +static void fetch_uc_fw (struct drm_i915_private *dev_priv,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
Re: [PATCH 2/8] drm/i915/guc: Create intel_guc_init_early
Quoted 27 lines · Sagar Arun Kamble
Prepared
intel_guc_init_earlyfor GuC Specific early initialization to be done fromintel_uc_init_early.Cc Michal Wajdeczko <[email protected]>Cc Michał Winiarski <[email protected]>Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_uc.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/intel_uc.c +1
-3@@ -101,10 +101,8 @@ static void gen8_guc_raise_irq(struct intel_guc *guc)I915_WRITE (GUC_SEND_INTERRUPT ,GUC_SEND_TRIGGER ); } -void intel_uc_init_early (struct drm_i915_private *dev_priv) +static void intel_guc_init_early (struct intel_guc *guc) { -struct intel_guc *guc = &dev_priv->guc; -intel_guc_ct_init_early (&guc->ct);mutex_init (&guc->send_mutex);@@ -112,6 +110,11 @@ void intel_uc_init_early(struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/intel_uc.c void intel_uc_init_early(struct drm_i915_private · line 120
Quoted 10 lines
drivers/gpu/drm/i915/intel_uc.c +5
-0guc->notify = gen8_guc_raise_irq; } +void intel_uc_init_early (struct drm_i915_private *dev_priv) +{ +intel_guc_init_early (&dev_priv->guc); +} +static void fetch_uc_fw (struct drm_i915_private *dev_priv,struct intel_uc_fw *uc_fw) {
hmm, maybe this patch can be squashed with next one as signature of the intel_guc_init_early() is changed there again
Michal
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/8 drm/i915/guc: Create intel_guc.c for defining GuC specific functionality
In reply to Sagar Arun KambleCreate intel_guc.c and added GuC specific functionality from intel_uc.c. Moved below functions to intel_guc.c.
1. intel_guc_send_nop
2. gen8_guc_raise_irq
3. intel_guc_init_early
4. guc_send_regs
5. intel_guc_init_send_regs
6. intel_guc_send_mmio
7. intel_guc_sample_forcewake
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/intel_guc.c | 146 +++++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uc.c | 121 -------------------------------- drivers/gpu/drm/i915/intel_uc.h | 11 +-- 4 files changed, 154 insertions(+), 125 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_guc.c
drivers/gpu/drm/i915/Makefile +1 -0
@@ -59,6 +59,7 @@ i915-y += i915_cmd_parser.o \ # general-purpose microcontroller (GuC) support i915-y += intel_uc.o \ + intel_guc.o \ intel_guc_ct.o \ intel_guc_log.o \ intel_guc_loader.o \
drivers/gpu/drm/i915/intel_guc.c new file +146 -0
146 lines not on this page · raw message
drivers/gpu/drm/i915/intel_uc.c +0 -121
136 lines not on this page · raw message
drivers/gpu/drm/i915/intel_uc.h +7 -4
@@ -208,10 +208,6 @@ struct intel_huc {void intel_uc_fini_fw (struct drm_i915_private *dev_priv);int intel_uc_init_hw (struct drm_i915_private *dev_priv);void intel_uc_fini_hw (struct drm_i915_private *dev_priv); -int intel_guc_sample_forcewake (struct intel_guc *guc); -int intel_guc_send_nop (struct intel_guc *guc,const u32 *action,u32 len); -int intel_guc_send_mmio (struct intel_guc *guc,const u32 *action,u32 len); -void intel_guc_init_send_regs (struct intel_guc *guc);static inline int intel_guc_send (struct intel_guc *guc,const u32 *action,u32 len) {
@@ -223,6 +219,13 @@ static inline void intel_guc_notify(struct intel_guc *guc) guc->notify (guc); } +/* intel_guc.c */ +int intel_guc_send_nop (struct intel_guc *guc,const u32 *action,u32 len); +void intel_guc_init_early (struct intel_guc *guc); +void intel_guc_init_send_regs (struct intel_guc *guc); +int intel_guc_send_mmio (struct intel_guc *guc,const u32 *action,u32 len); +int intel_guc_sample_forcewake (struct intel_guc *guc); +/* intel_guc_loader.c */ int intel_guc_select_fw (struct intel_guc *guc);int intel_guc_init_hw (struct intel_guc *guc);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 4/8 drm/i915/guc: Fix GuC interaction in reset/suspend scenarios
In reply to Sagar Arun KamblePass intel_guc to intel_guc_suspend/resume instead of drm_i915_private. guc_ggtt_invalidate/guc_interrupts should be disabled towards end of reset/suspend post GuC suspension as these are setup back again during recovery/resume.
Prepared helpers intel_guc_pause and intel_guc_unpause that will do teardown/bringup of this setup along with suspension/resumption of GuC if loaded. These helpers can then be used along the system or runtime suspend/resume paths as applicable. Currently post system resume, since GuC is loaded completely system_resume function for GuC is doing nothing. We rely on the setup happening in intel_uc_init_hw path. During runtime_suspend we will call intel_guc_pause helper. Another helper added is intel_guc_reset_prepare, this will make sure that disabling of ggtt_invalidate and GuC interrupts happens prior to reset and updates the firmware load status to PENDING.
v2: Updated commit message. Added note about skipped call to intel_guc_system_resume. guc_enable/disable_communication was moved to earlier patch so corresponding rebase. (Michal Wajdeczko)
v3: Introduction of intel_uc_runtime/system_suspend/resume. Updated changes for enable/disable_communication.
v4: Squashed change to update parameters of intel_guc_suspend/resume from earlier patch.
v5: Rebase as intel_guc.h is removed. Updated intel_uc_runtime_resume and intel_uc_system_resume as guc_enable_communication should happen prior to resuming the uc. Thanks to trybot for catching this. (Sagar)
--- drivers/gpu/drm/i915/i915_drv.c | 15 +++- drivers/gpu/drm/i915/i915_gem.c | 4 +- drivers/gpu/drm/i915/i915_guc_submission.c | 52 ------------ drivers/gpu/drm/i915/intel_guc.c | 129 +++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uc.c | 53 ++++++++++++ drivers/gpu/drm/i915/intel_uc.h | 12 ++- 6 files changed, 206 insertions(+), 59 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +11 -4
@@ -1684,6 +1684,11 @@ static int i915_drm_resume(struct drm_device *dev)drm_mode_config_reset (dev); +/* +* NB: Full gem reinitialization is being done during i915_drm_resume, +* hence intel_guc_system_resume will be of no use. If full +* reinitialization is avoided, need to call intel_guc_system_resume. +*/ mutex_lock (&dev->struct_mutex);if (i915_gem_init_hw (dev_priv)) {DRM_ERROR ("failed to re-initialize GPU, declaring wedged!\n" );
@@ -1691,8 +1696,6 @@ static int i915_drm_resume(struct drm_device *dev) }mutex_unlock (&dev->struct_mutex); -intel_guc_resume (dev_priv); -intel_modeset_init_hw (dev);spin_lock_irq (&dev_priv->irq_lock);
@@ -2493,7 +2496,7 @@ static int intel_runtime_suspend(struct device *kdev)*/ i915_gem_runtime_suspend (dev_priv); -intel_guc_suspend (dev_priv); +intel_uc_runtime_suspend (dev_priv);intel_runtime_pm_disable_interrupts (dev_priv);
@@ -2578,7 +2581,11 @@ static int intel_runtime_resume(struct device *kdev)if (intel_uncore_unclaimed_mmio (dev_priv))DRM_DEBUG_DRIVER ("Unclaimed access during suspend, bios?\n" ); -intel_guc_resume (dev_priv); + ret =intel_uc_runtime_resume (dev_priv); +if (ret) { +DRM_ERROR ("uc runtime resume failed (%d)\n" , ret); +return ret; + }if (IS_GEN9_LP (dev_priv)) {bxt_disable_dc9 (dev_priv);
drivers/gpu/drm/i915/i915_gem.c +3 -1
@@ -2847,6 +2847,8 @@ 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; }
@@ -4575,7 +4577,7 @@ int i915_gem_suspend(struct drm_i915_private *dev_priv)i915_gem_contexts_lost (dev_priv);mutex_unlock (&dev->struct_mutex); -intel_guc_suspend (dev_priv); +intel_uc_system_suspend (dev_priv);cancel_delayed_work_sync (&dev_priv->gpu_error.hangcheck_work);cancel_delayed_work_sync (&dev_priv->gt.retire_work);
drivers/gpu/drm/i915/i915_guc_submission.c +0 -52
55 lines not on this page · raw message
drivers/gpu/drm/i915/intel_guc.c +129 -0
132 lines not on this page · raw message
drivers/gpu/drm/i915/intel_uc.c +53 -0
56 lines not on this page · raw message
drivers/gpu/drm/i915/intel_uc.h +10 -2
@@ -208,6 +208,11 @@ struct intel_huc {void intel_uc_fini_fw (struct drm_i915_private *dev_priv);int intel_uc_init_hw (struct drm_i915_private *dev_priv);void intel_uc_fini_hw (struct drm_i915_private *dev_priv); +void intel_uc_reset_prepare (struct drm_i915_private *dev_priv); +void intel_uc_runtime_suspend (struct drm_i915_private *dev_priv); +int intel_uc_runtime_resume (struct drm_i915_private *dev_priv); +void intel_uc_system_suspend (struct drm_i915_private *dev_priv); +int intel_uc_system_resume (struct drm_i915_private *dev_priv);static inline int intel_guc_send (struct intel_guc *guc,const u32 *action,u32 len) {
@@ -225,12 +230,15 @@ static inline void intel_guc_notify(struct intel_guc *guc)void intel_guc_init_send_regs (struct intel_guc *guc);int intel_guc_send_mmio (struct intel_guc *guc,const u32 *action,u32 len);int intel_guc_sample_forcewake (struct intel_guc *guc); +void intel_guc_reset_prepare (struct intel_guc *guc); +int intel_guc_runtime_suspend (struct intel_guc *guc); +int intel_guc_runtime_resume (struct intel_guc *guc); +int intel_guc_system_suspend (struct intel_guc *guc); +int intel_guc_system_resume (struct intel_guc *guc);/* intel_guc_loader.c */ int intel_guc_select_fw (struct intel_guc *guc);int intel_guc_init_hw (struct intel_guc *guc); -int intel_guc_suspend (struct drm_i915_private *dev_priv); -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 */
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/8 drm/i915/guc: Fix GuC HW/SW state cleanup in unload path
In reply to Sagar Arun KambleTeardown of GuC HW/SW state was not properly done in unload path. guc_submission_disable was called as part of intel_uc_fini_hw which happens post gem_unload in the i915_driver_unload path. s/i915_gem_fini/i915_gem_cleanup as it looks more suitable as that function does cleanup.
To differentiate the tasks during suspend and unload w.r.t GuC this patch introduces new function i915_gem_fini which in addition to disabling GuC interfaces also disables GuC submission during which communication with GuC is needed for destroying doorbell. i915_gem_fini is copy of i915_gem_suspend with difference w.r.t GuC operations. To achieve this, new helpers i915_gem_context_suspend and i915_gem_suspend_complete are prepared.
This patch updates the functions responsibilities as follows:
1. intel_uc_fini_hw: Disable all things that involve communication with GuC and internal operation of GuC firmware, currently submission. Post this disable all other state like guc_ggtt_invalidate, guc_communication and guc_interrupts.
2. intel_uc_cleanup: Free up all UC related memory and other data.
v2: Prepared i915_gem_unload. (Michal)
v3: Moved guc_free_load_err_log past i915.enable_guc_loading check in intel_uc_cleanup_hw. Prepared i915_gem_contexts_suspend and i915_gem_suspend_complete that are used in the two paths i915_gem_suspend and i915_gem_unload. Unload specific actions like disabling GuC submission and GuC communication are being done in i915_gem_unload. Commit message update. (Michał Winiarski)
v4: prepared i915_gem_cleanup and intel_uc_cleanup.
v5: Rebase as intel_guc.h is removed. Kept guc_capture_load_err_log in intel_uc.c as it is not needed anywhere else. (Sagar)
--- drivers/gpu/drm/i915/i915_drv.c | 12 +++++----- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_gem.c | 52 ++++++++++++++++++++++++++++++++++++---- drivers/gpu/drm/i915/intel_guc.c | 32 +++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_uc.c | 28 ++++------------------ drivers/gpu/drm/i915/intel_uc.h | 3 +++ 6 files changed, 94 insertions(+), 34 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +6 -6
@@ -596,13 +596,13 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev) .can_switch = i915_switcheroo_can_switch, }; -static void i915_gem_fini (struct drm_i915_private *dev_priv) +static void i915_gem_cleanup (struct drm_i915_private *dev_priv) {/* Flush any outstanding unpin_work. */ i915_gem_drain_workqueue (dev_priv);mutex_lock (&dev_priv->drm.struct_mutex); -intel_uc_fini_hw (dev_priv); +intel_uc_cleanup (dev_priv);i915_gem_cleanup_engines (dev_priv);i915_gem_contexts_fini (dev_priv);i915_gem_cleanup_userptr (dev_priv);
@@ -683,9 +683,9 @@ static int i915_load_modeset_init(struct drm_device *dev)return 0 ; cleanup_gem: -if (i915_gem_suspend (dev_priv)) +if (i915_gem_fini (dev_priv))DRM_ERROR ("failed to idle hardware; continuing to unload!\n" ); -i915_gem_fini (dev_priv); +i915_gem_cleanup (dev_priv); cleanup_uc:intel_uc_fini_fw (dev_priv); cleanup_irq:
@@ -1376,7 +1376,7 @@ void i915_driver_unload(struct drm_device *dev)i915_driver_unregister (dev_priv); -if (i915_gem_suspend (dev_priv)) +if (i915_gem_fini (dev_priv))DRM_ERROR ("failed to idle hardware; continuing to unload!\n" );intel_display_power_get (dev_priv,POWER_DOMAIN_INIT );
@@ -1410,7 +1410,7 @@ void i915_driver_unload(struct drm_device *dev)cancel_delayed_work_sync (&dev_priv->gpu_error.hangcheck_work);i915_reset_error_state (dev_priv); -i915_gem_fini (dev_priv); +i915_gem_cleanup (dev_priv);intel_uc_fini_fw (dev_priv);intel_fbc_cleanup_cfb (dev_priv);
drivers/gpu/drm/i915/i915_drv.h +1 -0
@@ -3669,6 +3669,7 @@ void i915_gem_reset_engine(struct intel_engine_cs *engine,int i915_gem_wait_for_idle (struct drm_i915_private *dev_priv,unsigned int flags);int __must_check i915_gem_suspend (struct drm_i915_private *dev_priv); +int __must_check i915_gem_fini (struct drm_i915_private *dev_priv);void i915_gem_resume (struct drm_i915_private *dev_priv);int i915_gem_fault (struct vm_fault *vmf); int i915_gem_object_wait(struct drm_i915_gem_object *obj,
drivers/gpu/drm/i915/i915_gem.c +47 -5
79 lines not on this page · raw message
drivers/gpu/drm/i915/intel_guc.c +32 -0
@@ -273,3 +273,35 @@ int intel_guc_system_resume(struct intel_guc *guc)*/ return ret; } + +void intel_guc_fini_hw (struct intel_guc *guc) +{ +struct drm_i915_private *dev_priv =guc_to_i915 (guc); +struct drm_device *dev = &dev_priv->drm; + +if (i915.enable_guc_submission) { +mutex_lock (&dev->struct_mutex); +i915_guc_submission_disable (dev_priv); +mutex_unlock (&dev->struct_mutex); +intel_guc_reset_prepare (guc); + } +} + +static void guc_free_load_err_log (struct intel_guc *guc) +{ +if (guc->load_err_log) +i915_gem_object_put (guc->load_err_log); +} + +void intel_guc_cleanup (struct intel_guc *guc) +{ +struct drm_i915_private *dev_priv =guc_to_i915 (guc); + +if (!i915.enable_guc_loading) +return ; + +guc_free_load_err_log (guc); + +if (i915.enable_guc_submission) +i915_guc_submission_fini (dev_priv); +}
drivers/gpu/drm/i915/intel_uc.c +5 -23
@@ -256,14 +256,6 @@ static void guc_capture_load_err_log(struct intel_guc *guc)if (!guc->load_err_log) guc->load_err_log =i915_gem_object_get (guc->log.vma->obj); - -return ; -} - -static void guc_free_load_err_log (struct intel_guc *guc) -{ -if (guc->load_err_log) -i915_gem_object_put (guc->load_err_log); }static int guc_enable_communication (struct intel_guc *guc)
@@ -402,22 +394,12 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)void intel_uc_fini_hw (struct drm_i915_private *dev_priv) { -guc_free_load_err_log (&dev_priv->guc); - -if (!i915.enable_guc_loading) -return ; - -if (i915.enable_guc_submission) -i915_guc_submission_disable (dev_priv); - -guc_disable_communication (&dev_priv->guc); - -if (i915.enable_guc_submission) { -gen9_disable_guc_interrupts (dev_priv); -i915_guc_submission_fini (dev_priv); - } +intel_guc_fini_hw (&dev_priv->guc); +} -i915_ggtt_disable_guc (dev_priv); +void intel_uc_cleanup (struct drm_i915_private *dev_priv) +{ +intel_guc_cleanup (&dev_priv->guc); }void intel_uc_reset_prepare (struct drm_i915_private *dev_priv)
drivers/gpu/drm/i915/intel_uc.h +3 -0
@@ -208,6 +208,7 @@ struct intel_huc {void intel_uc_fini_fw (struct drm_i915_private *dev_priv);int intel_uc_init_hw (struct drm_i915_private *dev_priv);void intel_uc_fini_hw (struct drm_i915_private *dev_priv); +void intel_uc_cleanup (struct drm_i915_private *dev_priv);void intel_uc_reset_prepare (struct drm_i915_private *dev_priv);void intel_uc_runtime_suspend (struct drm_i915_private *dev_priv);int intel_uc_runtime_resume (struct drm_i915_private *dev_priv);
@@ -235,6 +236,8 @@ static inline void intel_guc_notify(struct intel_guc *guc)int intel_guc_runtime_resume (struct intel_guc *guc);int intel_guc_system_suspend (struct intel_guc *guc);int intel_guc_system_resume (struct intel_guc *guc); +void intel_guc_fini_hw (struct intel_guc *guc); +void intel_guc_cleanup (struct intel_guc *guc);/* intel_guc_loader.c */ int intel_guc_select_fw (struct intel_guc *guc);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 6/8 drm/i915/guc: Remove i915_guc_log_unregister
In reply to Sagar Arun KambleFunctionality needed to disable GuC interrupts and cleanup the runtime/relay data structures is already covered in the unload path via intel_guc_fini_hw and intel_guc_cleanup hence remove i915_guc_log_unregister
v2: Removed the function i915_guc_log_unregister.
v3: Rebase as intel_guc.h is removed.
--- drivers/gpu/drm/i915/i915_drv.c | 1 - drivers/gpu/drm/i915/intel_guc_log.c | 12 ------------ drivers/gpu/drm/i915/intel_uc.h | 1 - 3 files changed, 14 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +0 -1
@@ -1252,7 +1252,6 @@ static void i915_driver_unregister(struct drm_i915_private *dev_priv)i915_perf_unregister (dev_priv);i915_teardown_sysfs (dev_priv); -i915_guc_log_unregister (dev_priv);drm_dev_unregister (&dev_priv->drm);i915_gem_shrinker_cleanup (dev_priv);
drivers/gpu/drm/i915/intel_guc_log.c +0 -12
@@ -648,15 +648,3 @@ void i915_guc_log_register(struct drm_i915_private *dev_priv)guc_log_late_setup (&dev_priv->guc);mutex_unlock (&dev_priv->drm.struct_mutex); } - -void i915_guc_log_unregister (struct drm_i915_private *dev_priv) -{ -if (!i915.enable_guc_submission) -return ; - -mutex_lock (&dev_priv->drm.struct_mutex); -/* GuC logging is currently the only user of Guc2Host interrupts */ -gen9_disable_guc_interrupts (dev_priv); -guc_log_runtime_destroy (&dev_priv->guc); -mutex_unlock (&dev_priv->drm.struct_mutex); -}
drivers/gpu/drm/i915/intel_uc.h +0 -1
@@ -256,7 +256,6 @@ static inline void intel_guc_notify(struct intel_guc *guc)void intel_guc_log_destroy (struct intel_guc *guc);int i915_guc_log_control (struct drm_i915_private *dev_priv,u64 control_val);void i915_guc_log_register (struct drm_i915_private *dev_priv); -void i915_guc_log_unregister (struct drm_i915_private *dev_priv);static inline u32 guc_ggtt_offset (struct i915_vma *vma) {
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/8 drm/i915/guc: Enable default/critical logging in GuC by default from GuC v9
In reply to Sagar Arun KambleWith GuC v9, new type of Default/critical logging in GuC to enable capturing minimal important logs in production systems efficiently. This patch enables this logging in GuC by default always. It should be noted that streaming support with half-full interrupt mechanism that is present for normal logging is not present for this type of logging.
v2: Emulated GuC critical logging through i915.guc_log_level.
v3: Commit message update. Enable default/critical logging in GuC always. Fixed RPM wake during guc_log_unregister in the unload path.
v4: Moved RPM wake change to separate patch. Removed GUC_DEBUG_RESERVED and updated name of new bit to be version agnostic. Updated parameter to struct intel_guc * and name of macro NEEDS_GUC_CRITICAL_LOGGING. Removed explicit clearing of GUC_CRITICAL_LOGGING_DISABLED from params[GUC_CTL_DEBUG] as it is unnecessary. (Michal Wajdeczko)
v5: Removed GUC_CRITICAL_LOGGING_DISABLED. Added HAS_GUC check to GUC_NEEDS_CRITICAL_LOGGING. (Michal Wajdeczko)
v6: More refined version of GUC_NEEDS_CRITICAL_LOGGING. Commit message update. (Michal Wajdeczko)
--- drivers/gpu/drm/i915/intel_guc_fwif.h | 4 ++-- drivers/gpu/drm/i915/intel_guc_log.c | 13 ++++++++++++- 2 files changed, 14 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_guc_fwif.h +2 -2
@@ -127,7 +127,6 @@#define GUC_PROFILE_ENABLED (1 << 7)#define GUC_WQ_TRACK_ENABLED (1 << 8)#define GUC_ADS_ENABLED (1 << 9) -#define GUC_DEBUG_RESERVED (1 << 10)#define GUC_ADS_ADDR_SHIFT 11#define GUC_ADS_ADDR_MASK 0xfffff800
@@ -539,7 +538,8 @@ struct guc_log_buffer_state { u32 logging_enabled:1; u32 reserved1:3; u32 verbosity:4; - u32 reserved2:24; + u32 critical_logging_enabled:1; + u32 reserved2:23; };u32 value; } __packed;
drivers/gpu/drm/i915/intel_guc_log.c +12 -1
@@ -586,10 +586,18 @@ void intel_guc_log_destroy(struct intel_guc *guc)i915_vma_unpin_and_release (&guc->log.vma); } +/* +* Critical logging in GuC is to be enabled always from GuC v9+. +* (for KBL - v9.39+) +*/ +#define GUC_NEEDS_CRITICAL_LOGGING (guc) \ + (HAS_GUC(guc_to_i915(guc)) && \ + (guc->fw.major_ver_found >= 9) && \ + (guc->fw.minor_ver_found >= (IS_KABYLAKE(guc_to_i915(guc)) ? 39 : 0))) +int i915_guc_log_control (struct drm_i915_private *dev_priv,u64 control_val) {struct intel_guc *guc = &dev_priv->guc; -union guc_log_control log_param;int ret;
@@ -603,6 +611,9 @@ int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val)if (!log_param.logging_enabled && (i915.guc_log_level <0 ))return 0 ; +if (GUC_NEEDS_CRITICAL_LOGGING (guc)) + log_param.critical_logging_enabled =1 ; + ret =guc_log_control (guc, log_param.value);if (ret <0 ) {DRM_DEBUG_DRIVER ("guc_logging_control action failed %d\n" , ret);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/8 drm/i915: Reorganize HuC authentication
In reply to Sagar Arun KamblePrepared intel_auth_huc to separate HuC specific functionality from GuC send action. Created new header intel_huc.h to group HuC specific declarations.
v2: Changed argument preparation for AUTHENTICATE_HUC. s/intel_auth_huc/intel_huc_auth. Deferred creation of intel_huc.h to later patch.
v3: Rebase as intel_guc.h is removed. Added param description to intel_huc_auth. (Michal)
--- drivers/gpu/drm/i915/intel_guc.c | 18 ++++++++++++++++++ drivers/gpu/drm/i915/intel_huc.c | 22 +++++++--------------- drivers/gpu/drm/i915/intel_uc.c | 2 +- drivers/gpu/drm/i915/intel_uc.h | 3 ++- 4 files changed, 28 insertions(+), 17 deletions(-)
drivers/gpu/drm/i915/intel_guc.c +18 -0
@@ -305,3 +305,21 @@ void intel_guc_cleanup(struct intel_guc *guc)if (i915.enable_guc_submission)i915_guc_submission_fini (dev_priv); } + +/** +* intel_guc_auth_huc() - authenticate ucode +* @guc: struct intel_guc* +* @offset: rsa offset w.r.t ggtt base of huc vma +* +* triggers a huc fw authentication request to the guc via intel_guc_send +* authenticate_huc interface. +*/ +int intel_guc_auth_huc (struct intel_guc *guc,u32 rsa_offset) +{ +u32 action[] = { +INTEL_GUC_ACTION_AUTHENTICATE_HUC , + rsa_offset + }; + +return intel_guc_send (guc, action,ARRAY_SIZE (action)); +}
drivers/gpu/drm/i915/intel_huc.c +7 -15
@@ -225,19 +225,16 @@ void intel_huc_init_hw(struct intel_huc *huc) }/** -* intel_guc_auth_huc() - authenticate ucode -* @dev_priv: the drm_i915_device -* -* Triggers a HuC fw authentication request to the GuC via intel_guc_action_ -* authenticate_huc interface. +* intel_huc_auth() - authenticate ucode +* @huc: intel_huc structure */ -void intel_guc_auth_huc (struct drm_i915_private *dev_priv) +void intel_huc_auth (struct intel_huc *huc) { +struct drm_i915_private *dev_priv =huc_to_i915 (huc);struct intel_guc *guc = &dev_priv->guc; -struct intel_huc *huc = &dev_priv->huc;struct i915_vma *vma; +u32 offset;int ret; -u32 data[2 ];if (huc->fw.load_status !=INTEL_UC_FIRMWARE_SUCCESS )return ;
@@ -250,11 +247,8 @@ void intel_guc_auth_huc(struct drm_i915_private *dev_priv)return ; } -/* Specify auth action and where public signature is. */ - data[0 ] =INTEL_GUC_ACTION_AUTHENTICATE_HUC ; - data[1 ] =guc_ggtt_offset (vma) + huc->fw.rsa_offset; - - ret =intel_guc_send (guc, data,ARRAY_SIZE (data)); + offset =guc_ggtt_offset (vma) + huc->fw.rsa_offset; + ret =intel_guc_auth_huc (guc, offset);if (ret) {DRM_ERROR ("HuC: GuC did not ack Auth request %d\n" , ret); goto out;
@@ -266,7 +260,6 @@ void intel_guc_auth_huc(struct drm_i915_private *dev_priv)HUC_FW_VERIFIED ,HUC_FW_VERIFIED , 50); -if (ret) {DRM_ERROR ("HuC: Authentication failed %d\n" , ret); goto out;
@@ -275,4 +268,3 @@ void intel_guc_auth_huc(struct drm_i915_private *dev_priv) out:i915_vma_unpin (vma); } -
drivers/gpu/drm/i915/intel_uc.c +1 -1
@@ -343,7 +343,7 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)if (ret) goto err_log_capture; -intel_guc_auth_huc (dev_priv); +intel_huc_auth (&dev_priv->huc);if (i915.enable_guc_submission) {if (i915.guc_log_level >=0 )gen9_enable_guc_interrupts (dev_priv);
drivers/gpu/drm/i915/intel_uc.h +2 -1
@@ -238,6 +238,7 @@ static inline void intel_guc_notify(struct intel_guc *guc)int intel_guc_system_resume (struct intel_guc *guc);void intel_guc_fini_hw (struct intel_guc *guc);void intel_guc_cleanup (struct intel_guc *guc); +int intel_guc_auth_huc (struct intel_guc *guc,u32 rsa_offset);/* intel_guc_loader.c */ int intel_guc_select_fw (struct intel_guc *guc);
@@ -268,6 +269,6 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)/* intel_huc.c */ void intel_huc_select_fw (struct intel_huc *huc);void intel_huc_init_hw (struct intel_huc *huc); -void intel_guc_auth_huc (struct drm_i915_private *dev_priv); +void intel_huc_auth (struct intel_huc *huc);#endif
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 17 lines · Sagar Arun Kamble
s/guc_init_send_regs/intel_guc_init_send_regs.
Added declaration inintel_uc.h. Calling it fromintel_uc_init_hwas it is one time setup.Cc Michal Wajdeczko <[email protected]>Cc Michał Winiarski <[email protected]>Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_uc.c | 6 +++--- drivers/gpu/drm/i915/intel_uc.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/intel_uc.c +0
-0
drivers/gpu/drm/i915/intel_uc.c static inline i915_reg_t guc_send_reg(struct · line 274
Quoted 5 lines
drivers/gpu/drm/i915/intel_uc.c +1
-1@@ -271,7 +271,7 @@ static inline i915_reg_t guc_send_reg(struct intel_guc *guc, u32 i)return _MMIO (guc->send_regs.base +4 * i); } -static void guc_init_send_regs (struct intel_guc *guc) +void intel_guc_init_send_regs (struct intel_guc *guc)
Hmm, there is no reason to export this function now, as it called by the function defined below.
Quoted 12 lines
drivers/gpu/drm/i915/intel_uc.c +0
-2{struct drm_i915_private *dev_priv =guc_to_i915 (guc);enum forcewake_domains fw_domains =0 ;@@ -309,8 +309,6 @@ static int guc_enable_communication(struct intel_guc *guc) {struct drm_i915_private *dev_priv =guc_to_i915 (guc); -guc_init_send_regs (guc); -if (HAS_GUC_CT (dev_priv))return intel_guc_enable_ct (guc);
drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private · line 388
Quoted 5 lines
drivers/gpu/drm/i915/intel_uc.c +2
-0@@ -386,6 +384,8 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)if (ret) goto err_log_capture; +intel_guc_init_send_regs (guc); +
Hmm, if you want to make it 'one-time-setup' then this is still wrong place as intel_uc_init_hw() can be called several times during driver life cycle. Maybe all we need is new function intel_uc_init(dev_priv) as existing intel_uc_init_early() may be too early ;)
Michal
Quoted 15 lines
drivers/gpu/drm/i915/intel_uc.c +0
-0ret =guc_enable_communication (guc);if (ret) goto err_log_capture;drivers/gpu/drm/i915/intel_uc.h +1
-0@@ -211,6 +211,7 @@ struct intel_huc {int intel_guc_sample_forcewake (struct intel_guc *guc);int intel_guc_send_nop (struct intel_guc *guc,const u32 *action,u32 len);int intel_guc_send_mmio (struct intel_guc *guc,const u32 *action,u32 len); +void intel_guc_init_send_regs (struct intel_guc *guc);static inline int intel_guc_send (struct intel_guc *guc,const u32 *action,u32 len)
Quoted 1 line
{
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 14 lines · Michal Wajdeczko
Quoted 12 lines · Sagar Arun Kamble
s/guc_init_send_regs/intel_guc_init_send_regs.
Added declaration inintel_uc.h. Calling it fromintel_uc_init_hwas it is one time setup.Cc Michal Wajdeczko <[email protected]>Cc Michał Winiarski <[email protected]>Signed-off-by Sagar Arun Kamble <[email protected]>--- drivers/gpu/drm/i915/intel_uc.c | 6 +++--- drivers/gpu/drm/i915/intel_uc.h | 1 + 2 files changed, 4 insertions(+), 3 deletions(-)
Quoted 13 lines
drivers/gpu/drm/i915/intel_uc.c static inline i915_reg_t guc_send_reg(struct · line 274
Quoted 10 lines
drivers/gpu/drm/i915/intel_uc.c +1
-1@@ -271,7 +271,7 @@ static inline i915_reg_t guc_send_reg(struct intel_guc *guc, u32 i)return _MMIO (guc->send_regs.base +4 * i); } -static void guc_init_send_regs (struct intel_guc *guc) +void intel_guc_init_send_regs (struct intel_guc *guc)Hmm, there is no reason to export this function now, as it called by the function defined below.
Yeah :) ... I was probably thinking this to be defined in intel_guc.c which is changed with this series.
Quoted 25 lines
Quoted 13 lines
drivers/gpu/drm/i915/intel_uc.c +0
-2{struct drm_i915_private *dev_priv =guc_to_i915 (guc);enum forcewake_domains fw_domains =0 ;@@ -309,8 +309,6 @@ static int guc_enable_communication(struct intel_guc *guc) {struct drm_i915_private *dev_priv =guc_to_i915 (guc); -guc_init_send_regs (guc); -if (HAS_GUC_CT (dev_priv))return intel_guc_enable_ct (guc);drivers/gpu/drm/i915/intel_uc.c int intel_uc_init_hw(struct drm_i915_private · line 388
Quoted 5 lines
drivers/gpu/drm/i915/intel_uc.c +2
-0@@ -386,6 +384,8 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)if (ret) goto err_log_capture; +intel_guc_init_send_regs (guc); +Hmm, if you want to make it 'one-time-setup' then this is still wrong place as
intel_uc_init_hw()can be called several times during driver life cycle. Maybe all we need is new functionintel_uc_init(dev_priv)as existingintel_uc_init_early()may be too early ;)
Quoted 1 line
Michal
Right. Will move this in i915_driver_init_mmio after intel_uncore_init.
Quoted 17 lines
Quoted 16 lines
drivers/gpu/drm/i915/intel_uc.c +0
-0ret =guc_enable_communication (guc);if (ret) goto err_log_capture;drivers/gpu/drm/i915/intel_uc.h +1
-0@@ -211,6 +211,7 @@ struct intel_huc {int intel_guc_sample_forcewake (struct intel_guc *guc);int intel_guc_send_nop (struct intel_guc *guc,const u32 *action,u32 len);int intel_guc_send_mmio (struct intel_guc *guc,const u32 *action,u32 len); +void intel_guc_init_send_regs (struct intel_guc *guc);static inline int intel_guc_send (struct intel_guc *guc,const u32 *action,u32 len)Quoted 1 line
{
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for series starting with [1/8] drm/i915/guc: Export guc_init_send_regs and call only during intel_uc_init_hw
In reply to Sagar Arun Kamble== Series Details ==
== Series Details ==
Series: series starting with [1/8] drm/i915/guc: Export guc_init_send_regs and call only during intel_uc_init_hw
URL : https://patchwork.freedesktop.org/series/30502/
State : success
== Summary ==
Series 30502v1 series starting with [1/8] drm/i915/guc: Export guc_init_send_regs and call only during intel_uc_init_hw
https://patchwork.freedesktop.org/api/1.0/series/30502/revisions/1/mbox/
Test kms_cursor_legacy:
Subgroup basic-busy-flip-before-cursor-atomic:
fail -> PASS (fi-snb-2600) fdo#100215 +1fdo#100215 https://bugs.freedesktop.org/show_bug.cgi?id=100215
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:447s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:471s fi-blb-e6850 total:289 pass:224 dwarn:1 dfail:0 fail:0 skip:64 time:420s fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:514s fi-bwr-2160 total:289 pass:184 dwarn:0 dfail:0 fail:0 skip:105 time:277s fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:511s fi-byt-j1900 total:289 pass:254 dwarn:1 dfail:0 fail:0 skip:34 time:497s fi-byt-n2820 total:289 pass:250 dwarn:1 dfail:0 fail:0 skip:38 time:493s fi-cfl-s total:286 pass:222 dwarn:32 dfail:0 fail:0 skip:31 fi-elk-e7500 total:289 pass:230 dwarn:0 dfail:0 fail:0 skip:59 time:417s fi-glk-2a total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:592s fi-hsw-4770 total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:431s fi-hsw-4770r total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:410s fi-ilk-650 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:430s fi-ivb-3520m total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:493s fi-ivb-3770 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:463s fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:476s fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:586s fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:594s fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:453s fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:751s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:489s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:479s fi-snb-2520m total:289 pass:251 dwarn:0 dfail:0 fail:0 skip:38 time:569s fi-snb-2600 total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:425s
fi-pnv-d510 failed to connect after reboot
5299e24e48f3c24e612bcdb997d0dc477cdde0d0 drm-tip: 2017y-09m-18d-08h-44m-15s UTC integration manifest 53c49956930b drm/i915: Reorganize HuC authenticationef00b76aa0ed drm/i915/guc: Enable default/critical logging in GuC by default from GuC v9 5906c0b4e8bc drm/i915/guc: Remove i915_guc_log_unregister2e42ce116c18 drm/i915/guc: Fix GuC HW/SW state cleanup in unload path64e8639dddd9 drm/i915/guc: Fix GuC interaction in reset/suspend scenarios 54c1c4d674df drm/i915/guc: Create intel_guc.c for defining GuC specific functionality e36b9ffa4c53 drm/i915/guc: Create intel_guc_init_early0b442d5e2362 drm/i915/guc: Export guc_init_send_regs and call only during intel_uc_init_hw
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5725/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for series starting with [1/8] drm/i915/guc: Export guc_init_send_regs and call only during intel_uc_init_hw
In reply to Sagar Arun Kamble== Series Details ==
== Series Details ==
Series: series starting with [1/8] drm/i915/guc: Export guc_init_send_regs and call only during intel_uc_init_hw
URL : https://patchwork.freedesktop.org/series/30502/
State : success
== Summary ==
Test perf:
Subgroup polling:
pass -> FAIL (shard-hsw) fdo#102252fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
shard-hsw total:2313 pass:1244 dwarn:1 dfail:0 fail:13 skip:1055 time:9597s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_5725/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx