All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dave Gordon <david.s.gordon@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH v3 3/4] drm/i915/guc: symbolic name for GuC log-level none
Date: Fri, 22 Jul 2016 14:32:21 +0100	[thread overview]
Message-ID: <1469194342-8102-4-git-send-email-david.s.gordon@intel.com> (raw)
In-Reply-To: <1469194342-8102-1-git-send-email-david.s.gordon@intel.com>

The existing code that accesses the "guc_log_level" parameter
uses an explicit numerical value for the "no logging" case,
whereas there are symbolic names for the other levels.

So this patch just provides and uses a name for the default log
level (NONE), with the same numeric value that is already used.

This should produce identical code to the previous version!

Signed-off-by: Dave Gordon <david.s.gordon@intel.com>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_guc_submission.c | 2 +-
 drivers/gpu/drm/i915/intel_guc_fwif.h      | 1 +
 drivers/gpu/drm/i915/intel_guc_loader.c    | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_guc_submission.c b/drivers/gpu/drm/i915/i915_guc_submission.c
index e564c976..112e755 100644
--- a/drivers/gpu/drm/i915/i915_guc_submission.c
+++ b/drivers/gpu/drm/i915/i915_guc_submission.c
@@ -849,7 +849,7 @@ static void guc_create_log(struct intel_guc *guc)
 		obj = gem_allocate_guc_obj(dev_priv, size);
 		if (!obj) {
 			/* logging will be off */
-			i915.guc_log_level = -1;
+			i915.guc_log_level = GUC_LOG_VERBOSITY_NONE;
 			return;
 		}
 
diff --git a/drivers/gpu/drm/i915/intel_guc_fwif.h b/drivers/gpu/drm/i915/intel_guc_fwif.h
index 944786d..bd89f4e 100644
--- a/drivers/gpu/drm/i915/intel_guc_fwif.h
+++ b/drivers/gpu/drm/i915/intel_guc_fwif.h
@@ -132,6 +132,7 @@
 #define   GUC_LOG_VERBOSITY_HIGH	(2 << GUC_LOG_VERBOSITY_SHIFT)
 #define   GUC_LOG_VERBOSITY_ULTRA	(3 << GUC_LOG_VERBOSITY_SHIFT)
 /* Verbosity range-check limits, without the shift */
+#define	  GUC_LOG_VERBOSITY_NONE	(-1)
 #define	  GUC_LOG_VERBOSITY_MIN		0
 #define	  GUC_LOG_VERBOSITY_MAX		3
 #define	  GUC_LOG_VERBOSITY_MASK	0x0000000f
diff --git a/drivers/gpu/drm/i915/intel_guc_loader.c b/drivers/gpu/drm/i915/intel_guc_loader.c
index c2005b5..b9c9f15 100644
--- a/drivers/gpu/drm/i915/intel_guc_loader.c
+++ b/drivers/gpu/drm/i915/intel_guc_loader.c
@@ -175,7 +175,7 @@ static void set_guc_init_params(struct drm_i915_private *dev_priv)
 	params[GUC_CTL_FEATURE] |= GUC_CTL_DISABLE_SCHEDULER |
 			GUC_CTL_VCS2_ENABLED;
 
-	if (i915.guc_log_level >= 0) {
+	if (i915.guc_log_level > GUC_LOG_VERBOSITY_NONE) {
 		params[GUC_CTL_LOG_PARAMS] = guc->log_flags;
 		params[GUC_CTL_DEBUG] =
 			i915.guc_log_level << GUC_LOG_VERBOSITY_SHIFT;
-- 
1.9.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-07-22 13:32 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-22 13:32 [PATCH v3 0/4] drm/i915/guc: use symbolic names for module parameter values Dave Gordon
2016-07-22 13:32 ` [PATCH v3 1/4] drm/i915/guc: symbolic names for GuC submission preferences Dave Gordon
2016-08-01 13:54   ` Jani Nikula
2016-08-01 18:57     ` Dave Gordon
2016-08-02  7:23       ` Jani Nikula
2016-08-02  9:47       ` Dave Gordon
2016-07-22 13:32 ` [PATCH v3 2/4] drm/i915/guc: symbolic names for GuC firmare loading preferences Dave Gordon
2016-07-22 13:32 ` Dave Gordon [this message]
2016-07-22 13:32 ` [PATCH v3 4/4] drm/i915/guc: use symbolic names in setting defaults for module parameters Dave Gordon
2016-07-22 14:02 ` ✗ Ro.CI.BAT: warning for drm/i915/guc: use symbolic names for module parameter values Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1469194342-8102-4-git-send-email-david.s.gordon@intel.com \
    --to=david.s.gordon@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.