summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_guc_log.h
diff options
context:
space:
mode:
authorMichał Winiarski2018-03-20 12:55:17 +0100
committerChris Wilson2018-03-20 15:55:58 +0100
commit03380d173a697475c747e4cd6ea2be739005dedc (patch)
tree7ee3b8430fdc91265064f99d917e7e056c457aa7 /drivers/gpu/drm/i915/intel_guc_log.h
parentdrm/i915/icl: Update subslice define for ICL 11 (diff)
downloadkernel-qcow2-linux-03380d173a697475c747e4cd6ea2be739005dedc.tar.gz
kernel-qcow2-linux-03380d173a697475c747e4cd6ea2be739005dedc.tar.xz
kernel-qcow2-linux-03380d173a697475c747e4cd6ea2be739005dedc.zip
drm/i915/guc: Don't try to enable GuC logging when we're not using GuC
When changing the default values for guc_log_level, we accidentally left the log enabled on non-guc platforms. Let's fix that. v2: Define the levels used and remove (now obsolete) comments (Chris) v3: Use "IS" rather than "TO" for booleans (Chris) 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> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20180320115517.20423-1-michal.winiarski@intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_guc_log.h')
-rw-r--r--drivers/gpu/drm/i915/intel_guc_log.h12
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/gpu/drm/i915/intel_guc_log.h b/drivers/gpu/drm/i915/intel_guc_log.h
index af1532c0d3e4..1b0d2fa4c0b6 100644
--- a/drivers/gpu/drm/i915/intel_guc_log.h
+++ b/drivers/gpu/drm/i915/intel_guc_log.h
@@ -46,14 +46,16 @@ struct intel_guc;
* log enabling, and separate bit for default logging - which "conveniently"
* ignores the enable bit.
*/
-#define GUC_LOG_LEVEL_DISABLED 0
-#define GUC_LOG_LEVEL_TO_ENABLED(x) ((x) > 0)
-#define GUC_LOG_LEVEL_TO_VERBOSE(x) ((x) > 1)
+#define GUC_LOG_LEVEL_DISABLED 0
+#define GUC_LOG_LEVEL_NON_VERBOSE 1
+#define GUC_LOG_LEVEL_IS_ENABLED(x) ((x) > GUC_LOG_LEVEL_DISABLED)
+#define GUC_LOG_LEVEL_IS_VERBOSE(x) ((x) > GUC_LOG_LEVEL_NON_VERBOSE)
#define GUC_LOG_LEVEL_TO_VERBOSITY(x) ({ \
typeof(x) _x = (x); \
- GUC_LOG_LEVEL_TO_VERBOSE(_x) ? _x - 2 : 0; \
+ GUC_LOG_LEVEL_IS_VERBOSE(_x) ? _x - 2 : 0; \
})
-#define GUC_VERBOSITY_TO_LOG_LEVEL(x) ((x) + 2)
+#define GUC_VERBOSITY_TO_LOG_LEVEL(x) ((x) + 2)
+#define GUC_LOG_LEVEL_MAX GUC_VERBOSITY_TO_LOG_LEVEL(GUC_LOG_VERBOSITY_MAX)
struct intel_guc_log {
u32 flags;