summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_guc_log.h
diff options
context:
space:
mode:
authorMichał Winiarski2018-03-19 10:53:45 +0100
committerChris Wilson2018-03-19 13:23:02 +0100
commitcb5d64e9f13e0dd817c3ae2dbe73c3b8c6c13f95 (patch)
tree7a251975703573d11dafe3cd1ec262ee120c3ff9 /drivers/gpu/drm/i915/intel_guc_log.h
parentdrm/i915/guc: Don't print out relay statistics when relay is disabled (diff)
downloadkernel-qcow2-linux-cb5d64e9f13e0dd817c3ae2dbe73c3b8c6c13f95.tar.gz
kernel-qcow2-linux-cb5d64e9f13e0dd817c3ae2dbe73c3b8c6c13f95.tar.xz
kernel-qcow2-linux-cb5d64e9f13e0dd817c3ae2dbe73c3b8c6c13f95.zip
drm/i915/guc: Allow user to control default GuC logging
While both naming and actual log enable logic in GuC interface are confusing, we can simply expose the default log as yet another log level. GuC logic aside, from i915 point of view we now have the following GuC log levels: 0 Log disabled 1 Non-verbose log 2-5 Verbose log v2: Adjust naming after rebase. v3: Fixed the log_level logic error introduced on rebase. Signed-off-by: Michał Winiarski <michal.winiarski@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Sagar Arun Kamble <sagar.a.kamble@intel.com> Cc: Michal Wajdeczko <michal.wajdeczko@intel.com> Reviewed-by: Sagar Arun Kamble <sagar.a.kamble@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20180319095348.9716-10-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.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_guc_log.h b/drivers/gpu/drm/i915/intel_guc_log.h
index 9ec5703d712c..af1532c0d3e4 100644
--- a/drivers/gpu/drm/i915/intel_guc_log.h
+++ b/drivers/gpu/drm/i915/intel_guc_log.h
@@ -40,6 +40,21 @@ struct intel_guc;
#define GUC_LOG_SIZE ((1 + GUC_LOG_DPC_PAGES + 1 + GUC_LOG_ISR_PAGES + \
1 + GUC_LOG_CRASH_PAGES + 1) << PAGE_SHIFT)
+/*
+ * While we're using plain log level in i915, GuC controls are much more...
+ * "elaborate"? We have a couple of bits for verbosity, separate bit for actual
+ * 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_TO_VERBOSITY(x) ({ \
+ typeof(x) _x = (x); \
+ GUC_LOG_LEVEL_TO_VERBOSE(_x) ? _x - 2 : 0; \
+})
+#define GUC_VERBOSITY_TO_LOG_LEVEL(x) ((x) + 2)
+
struct intel_guc_log {
u32 flags;
struct i915_vma *vma;