drm/i915: Separate GuC/HuC specific functionality from intel_uc
Subsystems (2)
PATCH 1/6 drm/i915: Separate GuC/HuC specific functionality from intel_uc
From: "Kamble, Sagar A" <[email protected]>
Removed unnecessary intel_uc.h includes as it is present in i915_drv.h. Created intel_guc.c and intel_guc.h for placing GuC specific code. Created intel_huc.h to refer to HuC specific functions.
v2: Prepared intel_uc_common.h. Moved enable/disable_communication to intel_uc.c. huc_auth code declaration adjusted.
Restored static of guc_send_reg and kept along with other send functions s/guc_init_send_regs/intel_guc_init_send_regs and move the call to intel_uc_init_hw. Moved intel_guc_sample_forcewake moved to the end Moved intel_guc_init_early to the top. Moved guc_ggtt_offset after definition of intel_guc. Changed intel_guc_auth_huc prototype to accept guc struct and huc firmware struct. (Michal Wajdeczko)
v3: Removed intel_uc_common.h to associate similar includes for intel_guc.h and intel_huc.h through intel_uc.h itself. Updated intel_guc.h accordingly. In i915_drv.h now including intel_uc.h, intel_guc.h, intel_huc.h. Updated commit message. (Michal Winiarski) Changed definition of intel_guc_auth_huc to pass struct intel_huc in order to separate the wait for authentication status which is now prepared as separate function intel_huc_check_auth_status exported from intel_huc.c. Updated definition of intel_guc_suspend and intel_guc_resume to take struct intel_guc as parameter and move the declaration corresponding to those listed for i915_guc_submission.c declarations. (Michal Wajdeczko)intel_guc_suspend and intel_guc_resume are moved to intel_guc.c in the upcoming patches. Not sure if we should move intel_guc_allocate_vma also there. Currently functions are put in i915_guc_submission.c, intel_guc_ct.c, intel_guc_loader.c, intel_guc_log.c and intel_guc.c.
--- drivers/gpu/drm/i915/Makefile | 1 + drivers/gpu/drm/i915/i915_drv.c | 7 +- drivers/gpu/drm/i915/i915_drv.h | 2 + drivers/gpu/drm/i915/i915_gem.c | 2 +- drivers/gpu/drm/i915/i915_guc_submission.c | 11 +- drivers/gpu/drm/i915/intel_guc.c | 183 +++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_guc.h | 173 +++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_guc_loader.c | 1 - drivers/gpu/drm/i915/intel_huc.c | 56 +++------ drivers/gpu/drm/i915/intel_huc.h | 42 +++++++ drivers/gpu/drm/i915/intel_uc.c | 128 +------------------- drivers/gpu/drm/i915/intel_uc.h | 149 ----------------------- 12 files changed, 430 insertions(+), 325 deletions(-) create mode 100644 drivers/gpu/drm/i915/intel_guc.c create mode 100644 drivers/gpu/drm/i915/intel_guc.h create mode 100644 drivers/gpu/drm/i915/intel_huc.h
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/i915_drv.c +3 -4
@@ -50,7 +50,6 @@#include "i915_trace.h" #include "i915_vgpu.h" #include "intel_drv.h" -#include "intel_uc.h" static struct drm_driver driver;
@@ -1691,7 +1690,7 @@ static int i915_drm_resume(struct drm_device *dev) }mutex_unlock (&dev->struct_mutex); -intel_guc_resume (dev_priv); +intel_guc_resume (&dev_priv->guc);intel_modeset_init_hw (dev);
@@ -2493,7 +2492,7 @@ static int intel_runtime_suspend(struct device *kdev)*/ i915_gem_runtime_suspend (dev_priv); -intel_guc_suspend (dev_priv); +intel_guc_suspend (&dev_priv->guc);intel_runtime_pm_disable_interrupts (dev_priv);
@@ -2578,7 +2577,7 @@ 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); +intel_guc_resume (&dev_priv->guc);if (IS_GEN9_LP (dev_priv)) {bxt_disable_dc9 (dev_priv);
drivers/gpu/drm/i915/i915_drv.h +2 -0
@@ -59,6 +59,8 @@#include "intel_bios.h" #include "intel_dpll_mgr.h" #include "intel_uc.h" +#include "intel_guc.h" +#include "intel_huc.h" #include "intel_lrc.h" #include "intel_ringbuffer.h"
drivers/gpu/drm/i915/i915_gem.c +1 -1
@@ -4575,7 +4575,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_guc_suspend (&dev_priv->guc);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 +4 -7
@@ -23,7 +23,6 @@*/ #include <linux/circ_buf.h> #include "i915_drv.h" -#include "intel_uc.h" #include <trace/events/dma_fence.h>
@@ -1182,11 +1181,10 @@ void i915_guc_submission_disable(struct drm_i915_private *dev_priv)/** * intel_guc_suspend() - notify GuC entering suspend state -* @dev_priv: i915 device private */ -int intel_guc_suspend (struct drm_i915_private *dev_priv) +int intel_guc_suspend (struct intel_guc *guc) { -struct intel_guc *guc = &dev_priv->guc; +struct drm_i915_private *dev_priv =guc_to_i915 (guc);struct i915_gem_context *ctx;u32 data[3 ];
@@ -1208,11 +1206,10 @@ int intel_guc_suspend(struct drm_i915_private *dev_priv)/** * intel_guc_resume() - notify GuC resuming from suspend state -* @dev_priv: i915 device private */ -int intel_guc_resume (struct drm_i915_private *dev_priv) +int intel_guc_resume (struct intel_guc *guc) { -struct intel_guc *guc = &dev_priv->guc; +struct drm_i915_private *dev_priv =guc_to_i915 (guc);struct i915_gem_context *ctx;u32 data[3 ];
drivers/gpu/drm/i915/intel_guc.c new file +183 -0
183 lines not on this page · raw message
drivers/gpu/drm/i915/intel_guc.h new file +173 -0
173 lines not on this page · raw message
drivers/gpu/drm/i915/intel_guc_loader.c +0 -1
@@ -27,7 +27,6 @@* Alex Dai <[email protected]> */ #include "i915_drv.h" -#include "intel_uc.h" /** * DOC: GuC-specific firmware loader
drivers/gpu/drm/i915/intel_huc.c +16 -40
78 lines not on this page · raw message
drivers/gpu/drm/i915/intel_huc.h new file +42 -0
42 lines not on this page · raw message
drivers/gpu/drm/i915/intel_uc.c +5 -123
181 lines not on this page · raw message
drivers/gpu/drm/i915/intel_uc.h +0 -149
166 lines not on this page · raw message
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/6 drm/i915/guc: Make guc_enable/disable_communication functions public
From: "Kamble, Sagar A" <[email protected]>
This patch is moving guc_enable_communication and guc_disable_communication to intel_guc.c and making it available for use through intel_guc.h.
Intent is to reuse this function for calling from intel_uc_init_hw and also as part of intel_uc_fini_hw where it will be coupled with other teardown related to GuC in the upcoming patch.
--- drivers/gpu/drm/i915/intel_guc.c | 21 +++++++++++++++++++++ drivers/gpu/drm/i915/intel_guc.h | 2 ++ drivers/gpu/drm/i915/intel_uc.c | 29 ++++------------------------- 3 files changed, 27 insertions(+), 25 deletions(-)
drivers/gpu/drm/i915/intel_guc.c +21 -0
@@ -181,3 +181,24 @@ void intel_guc_auth_huc(struct intel_guc *guc, struct intel_huc *huc) out:i915_vma_unpin (vma); } + +int intel_guc_enable_communication (struct intel_guc *guc) +{ +struct drm_i915_private *dev_priv =guc_to_i915 (guc); + +if (HAS_GUC_CT (dev_priv)) +return intel_guc_enable_ct (guc); + + guc->send = intel_guc_send_mmio; +return 0 ; +} + +void intel_guc_disable_communication (struct intel_guc *guc) +{ +struct drm_i915_private *dev_priv =guc_to_i915 (guc); + +if (HAS_GUC_CT (dev_priv)) +intel_guc_disable_ct (guc); + + guc->send = intel_guc_send_nop; +}
drivers/gpu/drm/i915/intel_guc.h +2 -0
@@ -148,6 +148,8 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)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_auth_huc (struct intel_guc *guc,struct intel_huc *huc); +int intel_guc_enable_communication (struct intel_guc *guc); +void intel_guc_disable_communication (struct intel_guc *guc);/* intel_guc_loader.c */ int intel_guc_select_fw (struct intel_guc *guc);
drivers/gpu/drm/i915/intel_uc.c +4 -25
@@ -265,27 +265,6 @@ static void guc_free_load_err_log(struct intel_guc *guc)i915_gem_object_put (guc->load_err_log); } -static int guc_enable_communication (struct intel_guc *guc) -{ -struct drm_i915_private *dev_priv =guc_to_i915 (guc); - -if (HAS_GUC_CT (dev_priv)) -return intel_guc_enable_ct (guc); - - guc->send = intel_guc_send_mmio; -return 0 ; -} - -static void guc_disable_communication (struct intel_guc *guc) -{ -struct drm_i915_private *dev_priv =guc_to_i915 (guc); - -if (HAS_GUC_CT (dev_priv)) -intel_guc_disable_ct (guc); - - guc->send = intel_guc_send_nop; -} -int intel_uc_init_hw (struct drm_i915_private *dev_priv) {struct intel_guc *guc = &dev_priv->guc;
@@ -295,7 +274,7 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)if (!i915.enable_guc_loading)return 0 ; -guc_disable_communication (guc); +intel_guc_disable_communication (guc);gen9_reset_guc_interrupts (dev_priv);/* We need to notify the guc whenever we change the GGTT */
@@ -347,7 +326,7 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)intel_guc_init_send_regs (guc); - ret =guc_enable_communication (guc); + ret =intel_guc_enable_communication (guc);if (ret) goto err_log_capture;
@@ -373,7 +352,7 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)* marks the GPU as wedged until reset). */ err_interrupts: -guc_disable_communication (guc); +intel_guc_disable_communication (guc);gen9_disable_guc_interrupts (dev_priv); err_log_capture:guc_capture_load_err_log (guc);
@@ -410,7 +389,7 @@ void intel_uc_fini_hw(struct drm_i915_private *dev_priv)if (i915.enable_guc_submission)i915_guc_submission_disable (dev_priv); -guc_disable_communication (&dev_priv->guc); +intel_guc_disable_communication (&dev_priv->guc);if (i915.enable_guc_submission) {gen9_disable_guc_interrupts (dev_priv);
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/6 drm/i915/guc: Fix GuC interaction in reset/suspend scenarios
In reply to Sagar Arun KambleFrom: "Kamble, Sagar A" <[email protected]>
guc_ggtt_invalidate/guc_interrupts/guc_communication 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 runtim_suspend we will call intel_guc_pause helper that will suspend GuC operation by sending Host to GuC action ENTER_S_STATE and then disable ggtt_invalidate, disable GuC communication, disable GuC interrupts.
Another helper added is intel_guc_reset_prepare, this will make sure that disabling of ggtt_invalidate, communication and GuC interrupts happens prior to reset and updates the firmware load status to PENDING. This is applicable in case of full GPU reset though.
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)
--- drivers/gpu/drm/i915/i915_drv.c | 11 ++- drivers/gpu/drm/i915/i915_gem.c | 4 +- drivers/gpu/drm/i915/i915_guc_submission.c | 50 ----------- drivers/gpu/drm/i915/intel_guc.c | 131 +++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_guc.h | 7 +- 5 files changed, 146 insertions(+), 57 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +7 -4
@@ -1683,6 +1683,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" );
@@ -1690,8 +1695,6 @@ static int i915_drm_resume(struct drm_device *dev) }mutex_unlock (&dev->struct_mutex); -intel_guc_resume (&dev_priv->guc); -intel_modeset_init_hw (dev);spin_lock_irq (&dev_priv->irq_lock);
@@ -2492,7 +2495,7 @@ static int intel_runtime_suspend(struct device *kdev)*/ i915_gem_runtime_suspend (dev_priv); -intel_guc_suspend (&dev_priv->guc); +intel_guc_runtime_suspend (&dev_priv->guc);intel_runtime_pm_disable_interrupts (dev_priv);
@@ -2577,7 +2580,7 @@ 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->guc); +intel_guc_runtime_resume (&dev_priv->guc);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_guc_reset_prepare (&dev_priv->guc); +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->guc); +intel_guc_system_suspend (&dev_priv->guc);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 -50
53 lines not on this page · raw message
drivers/gpu/drm/i915/intel_guc.c +131 -0
134 lines not on this page · raw message
drivers/gpu/drm/i915/intel_guc.h +5 -2
@@ -150,6 +150,11 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)void intel_guc_auth_huc (struct intel_guc *guc,struct intel_huc *huc);int intel_guc_enable_communication (struct intel_guc *guc);void intel_guc_disable_communication (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);
@@ -162,8 +167,6 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)void i915_guc_submission_disable (struct drm_i915_private *dev_priv);void i915_guc_submission_fini (struct drm_i915_private *dev_priv);struct i915_vma *intel_guc_allocate_vma (struct intel_guc *guc,u32 size); -int intel_guc_suspend (struct intel_guc *guc); -int intel_guc_resume (struct intel_guc *guc);/* intel_guc_log.c */ int intel_guc_log_create (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/6 drm/i915/guc: Fix GuC HW/SW state cleanup in unload path
In reply to Sagar Arun KambleFrom: "Kamble, Sagar A" <[email protected]>
Teardown 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.
To differentiate the tasks during suspend and load w.r.t GuC this patch introduces new function i915_gem_unload which in addition to disabling GuC interfaces also disables GuC submission during which GuC communication with GuC is needed for destroying doorbell. i915_gem_unload 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_unload: 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_fini_hw: 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)
--- drivers/gpu/drm/i915/i915_drv.c | 4 ++-- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_gem.c | 52 ++++++++++++++++++++++++++++++++++++---- drivers/gpu/drm/i915/intel_guc.c | 13 ++++++++++ drivers/gpu/drm/i915/intel_guc.h | 1 + drivers/gpu/drm/i915/intel_uc.c | 18 ++++++-------- drivers/gpu/drm/i915/intel_uc.h | 1 + 7 files changed, 72 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/i915_drv.c +2 -2
@@ -682,7 +682,7 @@ static int i915_load_modeset_init(struct drm_device *dev)return 0 ; cleanup_gem: -if (i915_gem_suspend (dev_priv)) +if (i915_gem_unload (dev_priv))DRM_ERROR ("failed to idle hardware; continuing to unload!\n" );i915_gem_fini (dev_priv); cleanup_uc:
@@ -1375,7 +1375,7 @@ void i915_driver_unload(struct drm_device *dev)i915_driver_unregister (dev_priv); -if (i915_gem_suspend (dev_priv)) +if (i915_gem_unload (dev_priv))DRM_ERROR ("failed to idle hardware; continuing to unload!\n" );intel_display_power_get (dev_priv,POWER_DOMAIN_INIT );
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_unload (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 +13 -0
@@ -333,3 +333,16 @@ int intel_guc_system_resume(struct intel_guc *guc)*/ return ret; } + +void intel_guc_unload (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); + } +}
drivers/gpu/drm/i915/intel_guc.h +1 -0
@@ -155,6 +155,7 @@ static inline u32 guc_ggtt_offset(struct i915_vma *vma)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_unload (struct intel_guc *guc);/* intel_guc_loader.c */ int intel_guc_select_fw (struct intel_guc *guc);
drivers/gpu/drm/i915/intel_uc.c +7 -11
@@ -379,22 +379,18 @@ int intel_uc_init_hw(struct drm_i915_private *dev_priv)return ret; } -void intel_uc_fini_hw (struct drm_i915_private *dev_priv) +void intel_uc_unload (struct drm_i915_private *dev_priv) { -guc_free_load_err_log (&dev_priv->guc); +intel_guc_unload (&dev_priv->guc); +} +void intel_uc_fini_hw (struct drm_i915_private *dev_priv) +{if (!i915.enable_guc_loading)return ; -if (i915.enable_guc_submission) -i915_guc_submission_disable (dev_priv); - -intel_guc_disable_communication (&dev_priv->guc); +guc_free_load_err_log (&dev_priv->guc); -if (i915.enable_guc_submission) { -gen9_disable_guc_interrupts (dev_priv); +if (i915.enable_guc_submission)i915_guc_submission_fini (dev_priv); - } - -i915_ggtt_disable_guc (dev_priv); }
drivers/gpu/drm/i915/intel_uc.h +1 -0
@@ -104,6 +104,7 @@ struct intel_uc_fw {void intel_uc_init_fw (struct drm_i915_private *dev_priv);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_unload (struct drm_i915_private *dev_priv);void intel_uc_fini_hw (struct drm_i915_private *dev_priv);#endif
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 5/6 drm/i915/guc: Enable default/critical logging in GuC by default from GuC v9
In reply to Sagar Arun KambleFrom: "Kamble, Sagar A" <[email protected]>
With 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: Emulating GuC critical logging through i915.guc_log_level. Setting this to 0 will make GuC critical logging ON and setting it to 1-4 will communicate log level of 0-3 to GuC.
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)
--- drivers/gpu/drm/i915/intel_guc_fwif.h | 15 +++++++++++++-- drivers/gpu/drm/i915/intel_guc_log.c | 4 +++- 2 files changed, 16 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_guc_fwif.h +13 -2
@@ -131,7 +131,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
@@ -139,6 +138,17 @@#define GUC_CTL_MAX_DWORDS (SOFT_SCRATCH_COUNT - 2)/* [1..14] */ +/* +* 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)) && \ + (((IS_SKYLAKE(guc_to_i915(guc)) || IS_BROXTON(guc_to_i915(guc))) && \ + guc->fw.major_ver_found >= 9) || \ + (IS_KABYLAKE(guc_to_i915(guc)) && guc->fw.major_ver_found >= 9 && \ + guc->fw.minor_ver_found >= 39))) +/** * DOC: GuC Firmware Layout *
@@ -539,7 +549,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 +3 -1
@@ -589,7 +589,6 @@ void intel_guc_log_destroy(struct intel_guc *guc)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 +602,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 6/6 drm/i915/guc: Grab RPM wakelock while disabling GuC interrupts
In reply to Sagar Arun KambleFrom: "Kamble, Sagar A" <[email protected]>
Disabling GuC interrupts involves access to GuC IRQ control registers hence ensure device is RPM awake.
--- drivers/gpu/drm/i915/intel_guc_log.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/i915/intel_guc_log.c +2 -0
@@ -657,8 +657,10 @@ void i915_guc_log_unregister(struct drm_i915_private *dev_priv)return ;mutex_lock (&dev_priv->drm.struct_mutex); +intel_runtime_pm_get (dev_priv);/* GuC logging is currently the only user of Guc2Host interrupts */ gen9_disable_guc_interrupts (dev_priv); +intel_runtime_pm_put (dev_priv);guc_log_runtime_destroy (&dev_priv->guc);mutex_unlock (&dev_priv->drm.struct_mutex); }
Signature · 6 lines
1.9.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx