diff mbox

[v2,1/7] drm/i915/guc: Don't store runtime GuC log level in modparam

Message ID 20180604141947.8299-1-piotr.piorkowski@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Piotr Piórkowski June 4, 2018, 2:19 p.m. UTC
From: Piotr Piórkowski <piotr.piorkowski@intel.com>

Currently we are using modparam as placeholder for GuC log level.
Stop doing this and keep runtime GuC level in intel_guc_log struct.

v2:
- rename functions intel_guc_log_level_[get|set] to
intel_guc_log_[get|set]_level (Michał Wajdeczko)
- remove GEM_BUG_ON from intel_guc_log_get_level() (Michał Wajdeczko)

Signed-off-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Cc: Michal Wajdeczko <michal.wajdeczko@intel.com>
Cc: Michał Winiarski <michal.winiarski@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c  |  4 ++--
 drivers/gpu/drm/i915/intel_guc.c     |  8 +++-----
 drivers/gpu/drm/i915/intel_guc_log.c | 28 ++++++++++------------------
 drivers/gpu/drm/i915/intel_guc_log.h | 10 ++++++++--
 drivers/gpu/drm/i915/intel_uc.c      |  2 +-
 5 files changed, 24 insertions(+), 28 deletions(-)

Comments

Piotr Piórkowski June 12, 2018, 1:12 p.m. UTC | #1
On Tue, 2018-06-05 at 21:56 +0000, Patchwork wrote:
> == Series Details ==
> 
> Series: series starting with [v2,1/7] drm/i915/guc: Don't store
> runtime GuC log level in modparam (rev3)
> URL   : https://patchwork.freedesktop.org/series/44201/
> State : failure
> 
> == Summary ==
> 
> = CI Bug Log - changes from CI_DRM_4280_full -> Patchwork_9205_full =
> 
> == Summary - FAILURE ==
> 
>   Serious unknown changes coming with Patchwork_9205_full absolutely
> need to be
>   verified manually.
>   
>   If you think the reported changes have nothing to do with the
> changes
>   introduced in Patchwork_9205_full, please notify your bug team to
> allow them
>   to document this new failure mode, which will reduce false
> positives in CI.
> 
>   External URL: https://patchwork.freedesktop.org/api/1.0/series/4420
> 1/revisions/3/mbox/
> 
> == Possible new issues ==
> 
>   Here are the unknown changes that may have been introduced in
> Patchwork_9205_full:
> 
>   === IGT changes ===
> 
>     ==== Possible regressions ====
> 
>     igt@drv_selftest@live_hangcheck:
>       shard-kbl:          PASS -> DMESG-FAIL
> 
>     
>     ==== Warnings ====
> 
>     igt@drv_selftest@live_guc:
>       shard-kbl:          PASS -> SKIP +1
> 

These negative results do not relate to my changes.

> 
>   Here are the changes found in Patchwork_9205_full that come from
> known issues:
> 
>   === IGT changes ===
> 
>     ==== Issues hit ====
> 
>     igt@gem_ctx_isolation@bcs0-s3:
>       shard-kbl:          PASS -> INCOMPLETE (fdo#103665) +1
> 
>     igt@gem_eio@suspend:
>       shard-snb:          PASS -> FAIL (fdo#105957)
> 
>     igt@gem_ppgtt@blt-vs-render-ctxn:
>       shard-kbl:          PASS -> INCOMPLETE (fdo#103665, fdo#106023)
> 
>     igt@kms_flip@2x-plain-flip-fb-recreate-interruptible:
>       shard-glk:          PASS -> FAIL (fdo#100368) +2
> 
>     igt@kms_flip@flip-vs-expired-vblank-interruptible:
>       shard-glk:          PASS -> FAIL (fdo#102887, fdo#105363)
> 
>     igt@kms_flip_tiling@flip-y-tiled:
>       shard-glk:          PASS -> FAIL (fdo#104724, fdo#103822)
> 
>     
>     ==== Possible fixes ====
> 
>     igt@drv_selftest@live_gtt:
>       shard-glk:          INCOMPLETE (k.org#198133, fdo#103359) ->
> PASS
> 
>     igt@drv_selftest@live_hangcheck:
>       shard-apl:          DMESG-FAIL (fdo#106560) -> PASS
> 
>     igt@kms_flip@2x-flip-vs-expired-vblank:
>       shard-glk:          FAIL (fdo#105363) -> PASS
> 
>     
>   fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
>   fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
>   fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
>   fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
>   fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
>   fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
>   fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
>   fdo#105957 https://bugs.freedesktop.org/show_bug.cgi?id=105957
>   fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023
>   fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
>   k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133
> 
> 
> == Participating hosts (5 -> 5) ==
> 
>   No changes in participating hosts
> 
> 
> == Build changes ==
> 
>     * Linux: CI_DRM_4280 -> Patchwork_9205
> 
>   CI_DRM_4280: 967aa2f22752af3adc629b50e7d2ed2b7e061e44 @
> git://anongit.freedesktop.org/gfx-ci/linux
>   IGT_4507: 938135f033d7fd79c04a7a042d40f9d074489ffd @
> git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
>   Patchwork_9205: 2d8957f508dca1fd3b25f006a40388ea2a020080 @
> git://anongit.freedesktop.org/gfx-ci/linux
> 
> == Logs ==
> 
> For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchw
> ork_9205/shards.html
Chris Wilson June 12, 2018, 3:23 p.m. UTC | #2
Quoting Piorkowski, Piotr (2018-06-12 14:12:34)
> On Tue, 2018-06-05 at 21:56 +0000, Patchwork wrote:
> > == Series Details ==
> > 
> > Series: series starting with [v2,1/7] drm/i915/guc: Don't store
> > runtime GuC log level in modparam (rev3)
> > URL   : https://patchwork.freedesktop.org/series/44201/
> > State : failure
> > 
> > == Summary ==
> > 
> > = CI Bug Log - changes from CI_DRM_4280_full -> Patchwork_9205_full =
> > 
> > == Summary - FAILURE ==
> > 
> >   Serious unknown changes coming with Patchwork_9205_full absolutely
> > need to be
> >   verified manually.
> >   
> >   If you think the reported changes have nothing to do with the
> > changes
> >   introduced in Patchwork_9205_full, please notify your bug team to
> > allow them
> >   to document this new failure mode, which will reduce false
> > positives in CI.
> > 
> >   External URL: https://patchwork.freedesktop.org/api/1.0/series/4420
> > 1/revisions/3/mbox/
> > 
> > == Possible new issues ==
> > 
> >   Here are the unknown changes that may have been introduced in
> > Patchwork_9205_full:
> > 
> >   === IGT changes ===
> > 
> >     ==== Possible regressions ====
> > 
> >     igt@drv_selftest@live_hangcheck:
> >       shard-kbl:          PASS -> DMESG-FAIL
> > 
> >     
> >     ==== Warnings ====
> > 
> >     igt@drv_selftest@live_guc:
> >       shard-kbl:          PASS -> SKIP +1
> > 
> 
> These negative results do not relate to my changes.

Applied, but note for the future, your authorname and s-o-b are not an
exact match. Please fix so that the scripts don't complain (and let's
hope upstream is also forgiving).
-Chris
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 15e86d34a81c..a0fcdd3793a9 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -2536,7 +2536,7 @@  static int i915_guc_log_level_get(void *data, u64 *val)
 	if (!USES_GUC(dev_priv))
 		return -ENODEV;
 
-	*val = intel_guc_log_level_get(&dev_priv->guc.log);
+	*val = intel_guc_log_get_level(&dev_priv->guc.log);
 
 	return 0;
 }
@@ -2548,7 +2548,7 @@  static int i915_guc_log_level_set(void *data, u64 val)
 	if (!USES_GUC(dev_priv))
 		return -ENODEV;
 
-	return intel_guc_log_level_set(&dev_priv->guc.log, val);
+	return intel_guc_log_set_level(&dev_priv->guc.log, val);
 }
 
 DEFINE_SIMPLE_ATTRIBUTE(i915_guc_log_level_fops,
diff --git a/drivers/gpu/drm/i915/intel_guc.c b/drivers/gpu/drm/i915/intel_guc.c
index e28a996b9604..951a2df0496e 100644
--- a/drivers/gpu/drm/i915/intel_guc.c
+++ b/drivers/gpu/drm/i915/intel_guc.c
@@ -203,13 +203,11 @@  void intel_guc_fini(struct intel_guc *guc)
 	guc_shared_data_destroy(guc);
 }
 
-static u32 get_log_control_flags(void)
+static u32 guc_ctl_debug_flags(struct intel_guc *guc)
 {
-	u32 level = i915_modparams.guc_log_level;
+	u32 level = intel_guc_log_get_level(&guc->log);
 	u32 flags = 0;
 
-	GEM_BUG_ON(level < 0);
-
 	if (!GUC_LOG_LEVEL_IS_ENABLED(level))
 		flags |= GUC_LOG_DEFAULT_DISABLED;
 
@@ -250,7 +248,7 @@  void intel_guc_init_params(struct intel_guc *guc)
 
 	params[GUC_CTL_LOG_PARAMS] = guc->log.flags;
 
-	params[GUC_CTL_DEBUG] = get_log_control_flags();
+	params[GUC_CTL_DEBUG] = guc_ctl_debug_flags(guc);
 
 	/* If GuC submission is enabled, set up additional parameters here */
 	if (USES_GUC_SUBMISSION(dev_priv)) {
diff --git a/drivers/gpu/drm/i915/intel_guc_log.c b/drivers/gpu/drm/i915/intel_guc_log.c
index 401e1704d61e..d35d883d48e1 100644
--- a/drivers/gpu/drm/i915/intel_guc_log.c
+++ b/drivers/gpu/drm/i915/intel_guc_log.c
@@ -475,11 +475,12 @@  int intel_guc_log_create(struct intel_guc_log *log)
 	offset = intel_guc_ggtt_offset(guc, vma) >> PAGE_SHIFT;
 	log->flags = (offset << GUC_LOG_BUF_ADDR_SHIFT) | flags;
 
+	log->level = i915_modparams.guc_log_level;
+
 	return 0;
 
 err:
-	/* logging will be off */
-	i915_modparams.guc_log_level = 0;
+	DRM_ERROR("Failed to allocate GuC log buffer. %d\n", ret);
 	return ret;
 }
 
@@ -488,15 +489,7 @@  void intel_guc_log_destroy(struct intel_guc_log *log)
 	i915_vma_unpin_and_release(&log->vma);
 }
 
-int intel_guc_log_level_get(struct intel_guc_log *log)
-{
-	GEM_BUG_ON(!log->vma);
-	GEM_BUG_ON(i915_modparams.guc_log_level < 0);
-
-	return i915_modparams.guc_log_level;
-}
-
-int intel_guc_log_level_set(struct intel_guc_log *log, u64 val)
+int intel_guc_log_set_level(struct intel_guc_log *log, u32 level)
 {
 	struct intel_guc *guc = log_to_guc(log);
 	struct drm_i915_private *dev_priv = guc_to_i915(guc);
@@ -504,33 +497,32 @@  int intel_guc_log_level_set(struct intel_guc_log *log, u64 val)
 
 	BUILD_BUG_ON(GUC_LOG_VERBOSITY_MIN != 0);
 	GEM_BUG_ON(!log->vma);
-	GEM_BUG_ON(i915_modparams.guc_log_level < 0);
 
 	/*
 	 * GuC is recognizing log levels starting from 0 to max, we're using 0
 	 * as indication that logging should be disabled.
 	 */
-	if (val < GUC_LOG_LEVEL_DISABLED || val > GUC_LOG_LEVEL_MAX)
+	if (level < GUC_LOG_LEVEL_DISABLED || level > GUC_LOG_LEVEL_MAX)
 		return -EINVAL;
 
 	mutex_lock(&dev_priv->drm.struct_mutex);
 
-	if (i915_modparams.guc_log_level == val) {
+	if (log->level == level) {
 		ret = 0;
 		goto out_unlock;
 	}
 
 	intel_runtime_pm_get(dev_priv);
-	ret = guc_action_control_log(guc, GUC_LOG_LEVEL_IS_VERBOSE(val),
-				     GUC_LOG_LEVEL_IS_ENABLED(val),
-				     GUC_LOG_LEVEL_TO_VERBOSITY(val));
+	ret = guc_action_control_log(guc, GUC_LOG_LEVEL_IS_VERBOSE(level),
+				     GUC_LOG_LEVEL_IS_ENABLED(level),
+				     GUC_LOG_LEVEL_TO_VERBOSITY(level));
 	intel_runtime_pm_put(dev_priv);
 	if (ret) {
 		DRM_DEBUG_DRIVER("guc_log_control action failed %d\n", ret);
 		goto out_unlock;
 	}
 
-	i915_modparams.guc_log_level = val;
+	log->level = level;
 
 out_unlock:
 	mutex_unlock(&dev_priv->drm.struct_mutex);
diff --git a/drivers/gpu/drm/i915/intel_guc_log.h b/drivers/gpu/drm/i915/intel_guc_log.h
index fa80535a6f9d..f38c48950ed4 100644
--- a/drivers/gpu/drm/i915/intel_guc_log.h
+++ b/drivers/gpu/drm/i915/intel_guc_log.h
@@ -30,6 +30,7 @@ 
 #include <linux/workqueue.h>
 
 #include "intel_guc_fwif.h"
+#include "i915_gem.h"
 
 struct intel_guc;
 
@@ -58,6 +59,7 @@  struct intel_guc;
 #define GUC_LOG_LEVEL_MAX GUC_VERBOSITY_TO_LOG_LEVEL(GUC_LOG_VERBOSITY_MAX)
 
 struct intel_guc_log {
+	u32 level;
 	u32 flags;
 	struct i915_vma *vma;
 	struct {
@@ -80,8 +82,7 @@  void intel_guc_log_init_early(struct intel_guc_log *log);
 int intel_guc_log_create(struct intel_guc_log *log);
 void intel_guc_log_destroy(struct intel_guc_log *log);
 
-int intel_guc_log_level_get(struct intel_guc_log *log);
-int intel_guc_log_level_set(struct intel_guc_log *log, u64 control_val);
+int intel_guc_log_set_level(struct intel_guc_log *log, u32 level);
 bool intel_guc_log_relay_enabled(const struct intel_guc_log *log);
 int intel_guc_log_relay_open(struct intel_guc_log *log);
 void intel_guc_log_relay_flush(struct intel_guc_log *log);
@@ -89,4 +90,9 @@  void intel_guc_log_relay_close(struct intel_guc_log *log);
 
 void intel_guc_log_handle_flush_event(struct intel_guc_log *log);
 
+static inline u32 intel_guc_log_get_level(struct intel_guc_log *log)
+{
+	return log->level;
+}
+
 #endif
diff --git a/drivers/gpu/drm/i915/intel_uc.c b/drivers/gpu/drm/i915/intel_uc.c
index 6a73e81f373b..94e8863bd97c 100644
--- a/drivers/gpu/drm/i915/intel_uc.c
+++ b/drivers/gpu/drm/i915/intel_uc.c
@@ -207,7 +207,7 @@  void intel_uc_init_mmio(struct drm_i915_private *i915)
 
 static void guc_capture_load_err_log(struct intel_guc *guc)
 {
-	if (!guc->log.vma || !i915_modparams.guc_log_level)
+	if (!guc->log.vma || !intel_guc_log_get_level(&guc->log))
 		return;
 
 	if (!guc->load_err_log)