diff options
author | Michał Winiarski <michal.winiarski@intel.com> | 2018-03-19 10:53:45 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2018-03-19 12:23:02 +0000 |
commit | cb5d64e9f13e0dd817c3ae2dbe73c3b8c6c13f95 (patch) | |
tree | 7a251975703573d11dafe3cd1ec262ee120c3ff9 /drivers/gpu/drm/i915/intel_guc_log.h | |
parent | 5e24e4a240770008ed46d90d6571ec27b5e2bd5b (diff) | |
download | linux-stable-cb5d64e9f13e0dd817c3ae2dbe73c3b8c6c13f95.tar.gz linux-stable-cb5d64e9f13e0dd817c3ae2dbe73c3b8c6c13f95.tar.bz2 linux-stable-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.h | 15 |
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; |