[Intel-gfx] [PATCH] drm/i915/guc: Don't try to enable GuC logging when we're not using GuC

Chris Wilson chris at chris-wilson.co.uk
Tue Mar 20 00:18:26 UTC 2018


Quoting Michał Winiarski (2018-03-20 00:13:37)
> When changing the default values for guc_log_level, we accidentally left
> the log enabled on non-guc platforms. Let's fix that.
> 
> Fixes: 9605d1ce7c6b ("drm/i915/guc: Default to non-verbose GuC logging")
> Reported-by: Chris Wilson <chris at chris-wilson.co.uk>
> Signed-off-by: Michał Winiarski <michal.winiarski at intel.com>
> Cc: Chris Wilson <chris at chris-wilson.co.uk>
> Cc: Sagar Arun Kamble <sagar.a.kamble at intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko at intel.com>
> ---
>  drivers/gpu/drm/i915/intel_uc.c | 13 ++++++++-----
>  1 file changed, 8 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
> index 34e847d0ee4c..eb6667c7cd23 100644
> --- a/drivers/gpu/drm/i915/intel_uc.c
> +++ b/drivers/gpu/drm/i915/intel_uc.c
> @@ -69,14 +69,17 @@ static int __get_platform_enable_guc(struct drm_i915_private *dev_priv)
>  
>  static int __get_default_guc_log_level(struct drm_i915_private *dev_priv)
>  {
> -       int guc_log_level = 1; /* non-verbose */
> +       int guc_log_level;
>  
> -       /* Enable if we're running on platform with GuC and debug config */
> -       if (HAS_GUC(dev_priv) && intel_uc_is_using_guc() &&
> -           (IS_ENABLED(CONFIG_DRM_I915_DEBUG) ||
> -            IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM)))
> +       if (!HAS_GUC(dev_priv) || !intel_uc_is_using_guc())
> +               guc_log_level = 0; /* disabled */
> +       else if (IS_ENABLED(CONFIG_DRM_I915_DEBUG) ||
> +                IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
> +               /* Use full verbosity on platform with GuC and debug config */
>                 guc_log_level =
>                         GUC_VERBOSITY_TO_LOG_LEVEL(GUC_LOG_VERBOSITY_MAX);
		guc_log_level = GUC_LOG_LEVEL_MAX;

#define GUC_LOG_LEVEL_MAX GUC_VERBOSITY_TO_LOG_LEVEL(GUC_LOG_VERBOSITY_MAX)

in passing?
-Chris


More information about the Intel-gfx mailing list