aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_guc_log.h
diff options
context:
space:
mode:
authorMichał Winiarski <michal.winiarski@intel.com>2018-03-20 07:55:17 -0400
committerChris Wilson <chris@chris-wilson.co.uk>2018-03-20 10:55:58 -0400
commit03380d173a697475c747e4cd6ea2be739005dedc (patch)
tree7ee3b8430fdc91265064f99d917e7e056c457aa7 /drivers/gpu/drm/i915/intel_guc_log.h
parentd3d57927995f872e5786ff6ae517a6c3e7a94d75 (diff)
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;
46 * log enabling, and separate bit for default logging - which "conveniently" 46 * log enabling, and separate bit for default logging - which "conveniently"
47 * ignores the enable bit. 47 * ignores the enable bit.
48 */ 48 */
49#define GUC_LOG_LEVEL_DISABLED 0 49#define GUC_LOG_LEVEL_DISABLED 0
50#define GUC_LOG_LEVEL_TO_ENABLED(x) ((x) > 0) 50#define GUC_LOG_LEVEL_NON_VERBOSE 1
51#define GUC_LOG_LEVEL_TO_VERBOSE(x) ((x) > 1) 51#define GUC_LOG_LEVEL_IS_ENABLED(x) ((x) > GUC_LOG_LEVEL_DISABLED)
52#define GUC_LOG_LEVEL_IS_VERBOSE(x) ((x) > GUC_LOG_LEVEL_NON_VERBOSE)
52#define GUC_LOG_LEVEL_TO_VERBOSITY(x) ({ \ 53#define GUC_LOG_LEVEL_TO_VERBOSITY(x) ({ \
53 typeof(x) _x = (x); \ 54 typeof(x) _x = (x); \
54 GUC_LOG_LEVEL_TO_VERBOSE(_x) ? _x - 2 : 0; \ 55 GUC_LOG_LEVEL_IS_VERBOSE(_x) ? _x - 2 : 0; \
55}) 56})
56#define GUC_VERBOSITY_TO_LOG_LEVEL(x) ((x) + 2) 57#define GUC_VERBOSITY_TO_LOG_LEVEL(x) ((x) + 2)
58#define GUC_LOG_LEVEL_MAX GUC_VERBOSITY_TO_LOG_LEVEL(GUC_LOG_VERBOSITY_MAX)
57 59
58struct intel_guc_log { 60struct intel_guc_log {
59 u32 flags; 61 u32 flags;