drm/i915/guc: Don't store runtime GuC log level in modparam
Subsystems (2)
PATCH 1/1 drm/i915/guc: Don't store runtime GuC log level in modparam
From: Piotr Piórkowski <[email protected]>
Currently we are using modparam as placeholder for GuC log level. Stop doing this and keep runtime GuC level in intel_guc_log struct.
--- drivers/gpu/drm/i915/intel_guc.c | 8 +++----- drivers/gpu/drm/i915/intel_guc_log.c | 17 ++++++++--------- drivers/gpu/drm/i915/intel_guc_log.h | 3 ++- drivers/gpu/drm/i915/intel_uc.c | 2 +- 4 files changed, 14 insertions(+), 16 deletions(-)
drivers/gpu/drm/i915/intel_guc.c +3 -5
@@ -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 get_log_control_flags (struct intel_guc_log *log) { -u32 level = i915_modparams.guc_log_level; +u32 level = log->level;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 ] =get_log_control_flags (&guc->log);/* If GuC submission is enabled, set up additional parameters here */ if (USES_GUC_SUBMISSION (dev_priv)) {
drivers/gpu/drm/i915/intel_guc_log.c +8 -9
@@ -475,11 +475,13 @@ 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; +GEM_BUG_ON (i915_modparams.guc_log_level <0 ); + log->level = i915_modparams.guc_log_level; +return 0 ; err: -/* logging will be off */ - i915_modparams.guc_log_level =0 ; +DRM_DEBUG_DRIVER ("Failed to allocate GuC log buffer. %d\n" , ret);return ret; }
@@ -488,12 +490,10 @@ 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) +u32 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; +return log->level; }int intel_guc_log_level_set (struct intel_guc_log *log,u64 val)
@@ -504,7 +504,6 @@ 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
@@ -515,7 +514,7 @@ int intel_guc_log_level_set(struct intel_guc_log *log, u64 val)mutex_lock (&dev_priv->drm.struct_mutex); -if (i915_modparams.guc_log_level == val) { +if (log->level == val) { ret =0 ; goto out_unlock; }
@@ -530,7 +529,7 @@ int intel_guc_log_level_set(struct intel_guc_log *log, u64 val) goto out_unlock; } - i915_modparams.guc_log_level = val; + log->level = val; out_unlock:mutex_unlock (&dev_priv->drm.struct_mutex);
drivers/gpu/drm/i915/intel_guc_log.h +2 -1
@@ -59,6 +59,7 @@ struct intel_guc;struct intel_guc_log {u32 flags; +u32 level;struct i915_vma *vma;struct {void *buf_addr;
@@ -80,7 +81,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); +u32 intel_guc_log_level_get (struct intel_guc_log *log);int intel_guc_log_level_set (struct intel_guc_log *log,u64 control_val);bool intel_guc_log_relay_enabled (const struct intel_guc_log *log);int intel_guc_log_relay_open (struct intel_guc_log *log);
drivers/gpu/drm/i915/intel_uc.c +1 -1
@@ -208,7 +208,7 @@ void intel_uc_init_mmio(struct drm_i915_private *dev_priv)static void guc_capture_load_err_log (struct intel_guc *guc) { -if (!guc->log.vma || !i915_modparams.guc_log_level) +if (!guc->log.vma || !guc->log.level)return ;if (!guc->load_err_log)
Signature · 6 lines
2.14.3 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm/i915/guc: Don't store runtime GuC log level in modparam
== Series Details ==
== Series Details ==
Series: drm/i915/guc: Don't store runtime GuC log level in modparam
URL : https://patchwork.freedesktop.org/series/43013/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4163 -> Patchwork_8973 =
== Summary - SUCCESS ==
No regressions found.
External URL: https://patchwork.freedesktop.org/api/1.0/series/43013/revisions/1/mbox/
== Known issues ==
Here are the changes found in Patchwork_8973 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-cnl-psr: PASS -> DMESG-WARN (fdo#104951)
==== Possible fixes ====
igt@drv_module_reload@basic-reload-inject:
fi-glk-j4005: DMESG-WARN (fdo#106248) -> PASS
igt@gem_mmap_gtt@basic-small-bo-tiledx:
fi-gdg-551: FAIL (fdo#102575) -> PASS
igt@kms_flip@basic-flip-vs-wf_vblank:
fi-hsw-4770r: FAIL (fdo#100368) -> PASS fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
fdo#106248 https://bugs.freedesktop.org/show_bug.cgi?id=106248
== Participating hosts (41 -> 36) ==
Missing (5): fi-byt-j1900 fi-byt-squawks fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq
== Build changes ==
* Linux: CI_DRM_4163 -> Patchwork_8973
CI_DRM_4163: 8e1dab6e913be7d014eb9bc355ec65b6b56dcd56 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4468: 548a894dc904c4628522dbbc77cb179a4c965ebc @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8973: b1792bf8c0170919171d3ef49a254b961794321d @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4468: 1e60f1499e5b71b6d5a747189d7c28f57359a87f @ git://anongit.freedesktop.org/piglit
== Linux commits ==
b1792bf8c017 drm/i915/guc: Don't store runtime GuC log level in modparam
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8973/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm/i915/guc: Don't store runtime GuC log level in modparam
In reply to Piotr Piorkowski== Series Details ==
== Series Details ==
Series: drm/i915/guc: Don't store runtime GuC log level in modparam
URL : https://patchwork.freedesktop.org/series/43013/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4163_full -> Patchwork_8973_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_8973_full need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_8973_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/43013/revisions/1/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_8973_full:
=== IGT changes ===
==== Warnings ====
igt@gem_exec_schedule@deep-bsd2:
shard-kbl: SKIP -> PASS +3
igt@gem_mocs_settings@mocs-rc6-bsd1:
shard-kbl: PASS -> SKIP
igt@kms_force_connector_basic@force-connector-state:
shard-snb: PASS -> SKIP
igt@kms_properties@plane-properties-legacy:
shard-snb: SKIP -> PASS +4== Known issues ==
Here are the changes found in Patchwork_8973_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_cursor_crc@cursor-64x64-suspend:
shard-apl: PASS -> FAIL (fdo#103191, fdo#103232, fdo#104724, fdo#104645)
igt@kms_cursor_legacy@flip-vs-cursor-toggle:
shard-hsw: PASS -> FAIL (fdo#102670)
igt@kms_flip@flip-vs-absolute-wf_vblank-interruptible:
shard-apl: PASS -> FAIL (fdo#100368)
igt@kms_flip@plain-flip-fb-recreate-interruptible:
shard-glk: PASS -> FAIL (fdo#100368) +2
==== Possible fixes ====
igt@kms_flip@absolute-wf_vblank-interruptible:
shard-glk: FAIL (fdo#106087) -> PASS
igt@kms_flip@flip-vs-expired-vblank-interruptible:
shard-apl: FAIL (fdo#105363, fdo#102887) -> PASS
igt@kms_flip@wf_vblank-ts-check-interruptible:
shard-glk: FAIL (fdo#100368) -> PASS
shard-apl: FAIL (fdo#100368) -> PASS
igt@kms_setmode@basic:
shard-kbl: FAIL (fdo#99912) -> PASS fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232
fdo#104645 https://bugs.freedesktop.org/show_bug.cgi?id=104645
fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363
fdo#106087 https://bugs.freedesktop.org/show_bug.cgi?id=106087
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
== Participating hosts (9 -> 9) ==
No changes in participating hosts
== Build changes ==
* Linux: CI_DRM_4163 -> Patchwork_8973
CI_DRM_4163: 8e1dab6e913be7d014eb9bc355ec65b6b56dcd56 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4468: 548a894dc904c4628522dbbc77cb179a4c965ebc @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8973: b1792bf8c0170919171d3ef49a254b961794321d @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4468: 1e60f1499e5b71b6d5a747189d7c28f57359a87f @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8973/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Hi,
Quoted 22 lines · Piotr Piorkowski
From: Piotr Piórkowski <[email protected]>
Currently we are using modparam as placeholder for GuC log level. Stop doing this and keep runtime GuC level in
intel_guc_logstruct.Signed-off-by Piotr Piórkowski <[email protected]>Cc Michal Wajdeczko <[email protected]>Cc Michał Winiarski <[email protected]>Cc Joonas Lahtinen <[email protected]>Cc Chris Wilson <[email protected]>--- drivers/gpu/drm/i915/intel_guc.c | 8 +++----- drivers/gpu/drm/i915/intel_guc_log.c | 17 ++++++++--------- drivers/gpu/drm/i915/intel_guc_log.h | 3 ++- drivers/gpu/drm/i915/intel_uc.c | 2 +- 4 files changed, 14 insertions(+), 16 deletions(-)drivers/gpu/drm/i915/intel_guc.c +0
-0
drivers/gpu/drm/i915/intel_guc.c void intel_guc_fini(struct intel_guc *guc) · line 205
Quoted 4 lines
drivers/gpu/drm/i915/intel_guc.c +1
-1@@ -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 get_log_control_flags (struct intel_guc_log *log)
I would rather pass *guc here, as this is still intel_guc.c file, not intel_guc_log.*
drivers/gpu/drm/i915/intel_guc.c void intel_guc_fini(struct intel_guc *guc) · line 208
Quoted 3 lines
drivers/gpu/drm/i915/intel_guc.c +1
-1{ -u32 level = i915_modparams.guc_log_level; +u32 level = log->level;
As you still have dedicated function to read level (see below) maybe you should use it
drivers/gpu/drm/i915/intel_guc.c void intel_guc_init_params(struct intel_guc *guc) · line 249
Quoted 9 lines
drivers/gpu/drm/i915/intel_guc.c +1
-3u32 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 ] =get_log_control_flags (&guc->log);
As you touch function signature, maybe it is good time to rename it to:
static u32 guc_ctl_debug_flags(guc) { }as we may want to do similar thing for other complex params ;)
drivers/gpu/drm/i915/intel_guc_log.c int intel_guc_log_create(struct intel_guc_log *log) · line 477
Quoted 10 lines
drivers/gpu/drm/i915/intel_guc.c +0
-0/* If GuC submission is enabled, set up additional parameters here */ if (USES_GUC_SUBMISSION (dev_priv)) {drivers/gpu/drm/i915/intel_guc_log.c +1
-0@@ -475,11 +475,13 @@ 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; +GEM_BUG_ON (i915_modparams.guc_log_level <0 );
Maybe we don't need this GEM_BUG_ON as we have one in sanitize_options_early.
Quoted 11 lines
drivers/gpu/drm/i915/intel_guc_log.c +2
-0+ log->level = i915_modparams.guc_log_level; +return 0 ;err:
drivers/gpu/drm/i915/intel_guc_log.c +1
-2-/* logging will be off */ - i915_modparams.guc_log_level =0 ; +DRM_DEBUG_DRIVER ("Failed to allocate GuC log buffer. %d\n" , ret);return ret; }@@ -488,12 +490,10 @@ void intel_guc_log_destroy(struct intel_guc_log *log)
drivers/gpu/drm/i915/intel_guc_log.c void intel_guc_log_destroy(struct intel_guc_log · line 496
Quoted 10 lines
drivers/gpu/drm/i915/intel_guc_log.c +2
-4i915_vma_unpin_and_release (&log->vma); } -int intel_guc_log_level_get (struct intel_guc_log *log) +u32 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; +return log->level;
I guess this function can be now defined as inline in .h
Quoted 30 lines
drivers/gpu/drm/i915/intel_guc_log.c +2
-3}int intel_guc_log_level_set (struct intel_guc_log *log,u64 val)@@ -504,7 +504,6 @@ 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 @@ -515,7 +514,7 @@ int intel_guc_log_level_set(struct intel_guc_log *log, u64 val)mutex_lock (&dev_priv->drm.struct_mutex); -if (i915_modparams.guc_log_level == val) { +if (log->level == val) { ret =0 ; goto out_unlock; }@@ -530,7 +529,7 @@ int intel_guc_log_level_set(struct intel_guc_log *log, u64 val) goto out_unlock; } - i915_modparams.guc_log_level = val; + log->level = val;
out_unlock:drivers/gpu/drm/i915/intel_guc_log.c +0
-0mutex_unlock (&dev_priv->drm.struct_mutex);drivers/gpu/drm/i915/intel_guc_log.h +0
-0
drivers/gpu/drm/i915/intel_guc_log.h struct intel_guc; · line 61
Quoted 3 lines
drivers/gpu/drm/i915/intel_guc_log.h +1
-0@@ -59,6 +59,7 @@ struct intel_guc;struct intel_guc_log {u32 flags; +u32 level;
[bikeshed] I would reorder above, as 'level' is more important than static flags ...
btw, maybe we can replace that 'flags' with static function in intel_guc.c similar to existing one like:
static u32 guc_ctl_log_flags(guc) { }Quoted 17 lines
drivers/gpu/drm/i915/intel_guc_log.h +1
-1struct i915_vma *vma;struct {void *buf_addr;@@ -80,7 +81,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); +u32 intel_guc_log_level_get (struct intel_guc_log *log);int intel_guc_log_level_set (struct intel_guc_log *log,u64 control_val);bool intel_guc_log_relay_enabled (const struct intel_guc_log *log);int intel_guc_log_relay_open (struct intel_guc_log *log);drivers/gpu/drm/i915/intel_uc.c +0
-0
drivers/gpu/drm/i915/intel_uc.c void intel_uc_init_mmio(struct drm_i915_private · line 213
Quoted 7 lines
drivers/gpu/drm/i915/intel_uc.c +1
-1@@ -208,7 +208,7 @@ void intel_uc_init_mmio(struct drm_i915_private *dev_priv)static void guc_capture_load_err_log (struct intel_guc *guc) { -if (!guc->log.vma || !i915_modparams.guc_log_level) +if (!guc->log.vma || !guc->log.level)return ;if (!guc->load_err_log)
Thanks,
Michal
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx