|
@@ -33,11 +33,10 @@ static void guc_log_capture_logs(struct intel_guc *guc);
|
|
|
/**
|
|
|
* DOC: GuC firmware log
|
|
|
*
|
|
|
- * Firmware log is enabled by setting i915.guc_log_level to non-negative level.
|
|
|
+ * Firmware log is enabled by setting i915.guc_log_level to the positive level.
|
|
|
* Log data is printed out via reading debugfs i915_guc_log_dump. Reading from
|
|
|
* i915_guc_load_status will print out firmware loading status and scratch
|
|
|
* registers value.
|
|
|
- *
|
|
|
*/
|
|
|
|
|
|
static int guc_log_flush_complete(struct intel_guc *guc)
|
|
@@ -147,7 +146,7 @@ static int guc_log_relay_file_create(struct intel_guc *guc)
|
|
|
struct dentry *log_dir;
|
|
|
int ret;
|
|
|
|
|
|
- if (i915_modparams.guc_log_level < 0)
|
|
|
+ if (!i915_modparams.guc_log_level)
|
|
|
return 0;
|
|
|
|
|
|
/* For now create the log file in /sys/kernel/debug/dri/0 dir */
|
|
@@ -423,8 +422,8 @@ static void guc_log_runtime_destroy(struct intel_guc *guc)
|
|
|
{
|
|
|
/*
|
|
|
* It's possible that the runtime stuff was never allocated because
|
|
|
- * guc_log_level was < 0 at the time
|
|
|
- **/
|
|
|
+ * GuC log was disabled at the boot time.
|
|
|
+ */
|
|
|
if (!guc_log_has_runtime(guc))
|
|
|
return;
|
|
|
|
|
@@ -441,9 +440,10 @@ static int guc_log_late_setup(struct intel_guc *guc)
|
|
|
lockdep_assert_held(&dev_priv->drm.struct_mutex);
|
|
|
|
|
|
if (!guc_log_has_runtime(guc)) {
|
|
|
- /* If log_level was set as -1 at boot time, then setup needed to
|
|
|
- * handle log buffer flush interrupts would not have been done yet,
|
|
|
- * so do that now.
|
|
|
+ /*
|
|
|
+ * If log was disabled at boot time, then setup needed to handle
|
|
|
+ * log buffer flush interrupts would not have been done yet, so
|
|
|
+ * do that now.
|
|
|
*/
|
|
|
ret = guc_log_runtime_create(guc);
|
|
|
if (ret)
|
|
@@ -460,7 +460,7 @@ err_runtime:
|
|
|
guc_log_runtime_destroy(guc);
|
|
|
err:
|
|
|
/* logging will remain off */
|
|
|
- i915_modparams.guc_log_level = -1;
|
|
|
+ i915_modparams.guc_log_level = 0;
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
@@ -482,8 +482,7 @@ static void guc_flush_logs(struct intel_guc *guc)
|
|
|
{
|
|
|
struct drm_i915_private *dev_priv = guc_to_i915(guc);
|
|
|
|
|
|
- if (!USES_GUC_SUBMISSION(dev_priv) ||
|
|
|
- (i915_modparams.guc_log_level < 0))
|
|
|
+ if (!USES_GUC_SUBMISSION(dev_priv) || !i915_modparams.guc_log_level)
|
|
|
return;
|
|
|
|
|
|
/* First disable the interrupts, will be renabled afterwards */
|
|
@@ -511,9 +510,6 @@ int intel_guc_log_create(struct intel_guc *guc)
|
|
|
|
|
|
GEM_BUG_ON(guc->log.vma);
|
|
|
|
|
|
- if (i915_modparams.guc_log_level > GUC_LOG_VERBOSITY_MAX)
|
|
|
- i915_modparams.guc_log_level = GUC_LOG_VERBOSITY_MAX;
|
|
|
-
|
|
|
/* The first page is to save log buffer state. Allocate one
|
|
|
* extra page for others in case for overlap */
|
|
|
size = (1 + GUC_LOG_DPC_PAGES + 1 +
|
|
@@ -537,7 +533,7 @@ int intel_guc_log_create(struct intel_guc *guc)
|
|
|
|
|
|
guc->log.vma = vma;
|
|
|
|
|
|
- if (i915_modparams.guc_log_level >= 0) {
|
|
|
+ if (i915_modparams.guc_log_level) {
|
|
|
ret = guc_log_runtime_create(guc);
|
|
|
if (ret < 0)
|
|
|
goto err_vma;
|
|
@@ -558,7 +554,7 @@ err_vma:
|
|
|
i915_vma_unpin_and_release(&guc->log.vma);
|
|
|
err:
|
|
|
/* logging will be off */
|
|
|
- i915_modparams.guc_log_level = -1;
|
|
|
+ i915_modparams.guc_log_level = 0;
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
@@ -582,7 +578,7 @@ int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val)
|
|
|
return -EINVAL;
|
|
|
|
|
|
/* This combination doesn't make sense & won't have any effect */
|
|
|
- if (!log_param.logging_enabled && (i915_modparams.guc_log_level < 0))
|
|
|
+ if (!log_param.logging_enabled && !i915_modparams.guc_log_level)
|
|
|
return 0;
|
|
|
|
|
|
ret = guc_log_control(guc, log_param.value);
|
|
@@ -592,11 +588,12 @@ int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val)
|
|
|
}
|
|
|
|
|
|
if (log_param.logging_enabled) {
|
|
|
- i915_modparams.guc_log_level = log_param.verbosity;
|
|
|
+ i915_modparams.guc_log_level = 1 + log_param.verbosity;
|
|
|
|
|
|
- /* If log_level was set as -1 at boot time, then the relay channel file
|
|
|
- * wouldn't have been created by now and interrupts also would not have
|
|
|
- * been enabled. Try again now, just in case.
|
|
|
+ /*
|
|
|
+ * If log was disabled at boot time, then the relay channel file
|
|
|
+ * wouldn't have been created by now and interrupts also would
|
|
|
+ * not have been enabled. Try again now, just in case.
|
|
|
*/
|
|
|
ret = guc_log_late_setup(guc);
|
|
|
if (ret < 0) {
|
|
@@ -607,7 +604,8 @@ int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val)
|
|
|
/* GuC logging is currently the only user of Guc2Host interrupts */
|
|
|
gen9_enable_guc_interrupts(dev_priv);
|
|
|
} else {
|
|
|
- /* Once logging is disabled, GuC won't generate logs & send an
|
|
|
+ /*
|
|
|
+ * Once logging is disabled, GuC won't generate logs & send an
|
|
|
* interrupt. But there could be some data in the log buffer
|
|
|
* which is yet to be captured. So request GuC to update the log
|
|
|
* buffer state and then collect the left over logs.
|
|
@@ -615,7 +613,7 @@ int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val)
|
|
|
guc_flush_logs(guc);
|
|
|
|
|
|
/* As logging is disabled, update log level to reflect that */
|
|
|
- i915_modparams.guc_log_level = -1;
|
|
|
+ i915_modparams.guc_log_level = 0;
|
|
|
}
|
|
|
|
|
|
return ret;
|
|
@@ -623,8 +621,7 @@ int i915_guc_log_control(struct drm_i915_private *dev_priv, u64 control_val)
|
|
|
|
|
|
void i915_guc_log_register(struct drm_i915_private *dev_priv)
|
|
|
{
|
|
|
- if (!USES_GUC_SUBMISSION(dev_priv) ||
|
|
|
- (i915_modparams.guc_log_level < 0))
|
|
|
+ if (!USES_GUC_SUBMISSION(dev_priv) || !i915_modparams.guc_log_level)
|
|
|
return;
|
|
|
|
|
|
mutex_lock(&dev_priv->drm.struct_mutex);
|