diff mbox

drm/i915/guc: Don't try to enable GuC logging when we're not using GuC

Message ID 20180320001337.23676-1-michal.winiarski@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Michał Winiarski March 20, 2018, 12:13 a.m. UTC
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@chris-wilson.co.uk>
Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/i915/intel_uc.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

Comments

Chris Wilson March 20, 2018, 12:18 a.m. UTC | #1
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@chris-wilson.co.uk>
> Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com>
> Cc: Michal Wajdeczko <michal.wajdeczko@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
Chris Wilson March 20, 2018, 2:55 p.m. UTC | #2
Quoting Patchwork (2018-03-20 14:52:05)
> == Series Details ==
> 
> Series: drm/i915/guc: Don't try to enable GuC logging when we're not using GuC (rev3)
> URL   : https://patchwork.freedesktop.org/series/40239/
> State : success
> 
> == Summary ==
> 

No more editing, pushed! Thanks,
-Chris
diff mbox

Patch

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);
+	else
+		guc_log_level = 1; /* non-verbose */
 
 	/* Any platform specific fine-tuning can be done here */