Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromtorvalds/linux

Commitcb5d64e

Browse files
mwiniarsickle
authored andcommitted
drm/i915/guc: Allow user to control default GuC logging
While both naming and actual log enable logic in GuC interface areconfusing, we can simply expose the default log as yet another loglevel.GuC logic aside, from i915 point of view we now have the following GuClog levels:0 Log disabled1 Non-verbose log2-5 Verbose logv2: 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
1 parent5e24e4a commitcb5d64e

File tree

5 files changed

+49
-27
lines changed

5 files changed

+49
-27
lines changed

‎drivers/gpu/drm/i915/intel_guc.c‎

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -222,17 +222,23 @@ static u32 get_core_family(struct drm_i915_private *dev_priv)
222222
}
223223
}
224224

225-
staticu32get_log_verbosity_flags(void)
225+
staticu32get_log_control_flags(void)
226226
{
227-
if (i915_modparams.guc_log_level>0) {
228-
u32verbosity=i915_modparams.guc_log_level-1;
227+
u32level=i915_modparams.guc_log_level;
228+
u32flags=0;
229229

230-
GEM_BUG_ON(verbosity>GUC_LOG_VERBOSITY_MAX);
231-
returnverbosity <<GUC_LOG_VERBOSITY_SHIFT;
232-
}
230+
GEM_BUG_ON(level<0);
231+
232+
if (!GUC_LOG_LEVEL_TO_ENABLED(level))
233+
flags |=GUC_LOG_DEFAULT_DISABLED;
234+
235+
if (!GUC_LOG_LEVEL_TO_VERBOSE(level))
236+
flags |=GUC_LOG_DISABLED;
237+
else
238+
flags |=GUC_LOG_LEVEL_TO_VERBOSITY(level) <<
239+
GUC_LOG_VERBOSITY_SHIFT;
233240

234-
GEM_BUG_ON(i915_modparams.enable_guc<0);
235-
returnGUC_LOG_DISABLED;
241+
returnflags;
236242
}
237243

238244
/*
@@ -267,7 +273,7 @@ void intel_guc_init_params(struct intel_guc *guc)
267273

268274
params[GUC_CTL_LOG_PARAMS]=guc->log.flags;
269275

270-
params[GUC_CTL_DEBUG]=get_log_verbosity_flags();
276+
params[GUC_CTL_DEBUG]=get_log_control_flags();
271277

272278
/* If GuC submission is enabled, set up additional parameters here */
273279
if (USES_GUC_SUBMISSION(dev_priv)) {

‎drivers/gpu/drm/i915/intel_guc_fwif.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
#defineGUC_PROFILE_ENABLED(1 << 7)
128128
#defineGUC_WQ_TRACK_ENABLED(1 << 8)
129129
#defineGUC_ADS_ENABLED(1 << 9)
130-
#defineGUC_DEBUG_RESERVED(1 << 10)
130+
#defineGUC_LOG_DEFAULT_DISABLED(1 << 10)
131131
#defineGUC_ADS_ADDR_SHIFT11
132132
#defineGUC_ADS_ADDR_MASK0xfffff800
133133

@@ -539,7 +539,8 @@ union guc_log_control {
539539
u32logging_enabled:1;
540540
u32reserved1:3;
541541
u32verbosity:4;
542-
u32reserved2:24;
542+
u32default_logging:1;
543+
u32reserved2:23;
543544
};
544545
u32value;
545546
}__packed;

‎drivers/gpu/drm/i915/intel_guc_log.c‎

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,12 +57,14 @@ static int guc_log_flush(struct intel_guc *guc)
5757
returnintel_guc_send(guc,action,ARRAY_SIZE(action));
5858
}
5959

60-
staticintguc_log_control(structintel_guc*guc,boolenable,u32verbosity)
60+
staticintguc_log_control(structintel_guc*guc,boolenable,
61+
booldefault_logging,u32verbosity)
6162
{
6263
unionguc_log_controlcontrol_val= {
6364
{
6465
.logging_enabled=enable,
6566
.verbosity=verbosity,
67+
.default_logging=default_logging,
6668
},
6769
};
6870
u32action[]= {
@@ -499,13 +501,6 @@ int intel_guc_log_level_get(struct intel_guc_log *log)
499501
returni915_modparams.guc_log_level;
500502
}
501503

502-
#defineGUC_LOG_LEVEL_DISABLED0
503-
#defineLOG_LEVEL_TO_ENABLED(x)((x) > 0)
504-
#defineLOG_LEVEL_TO_VERBOSITY(x) ({\
505-
typeof(x) _x = (x);\
506-
LOG_LEVEL_TO_ENABLED(_x) ? _x - 1 : 0;\
507-
})
508-
#defineVERBOSITY_TO_LOG_LEVEL(x) ((x) + 1)
509504
intintel_guc_log_level_set(structintel_guc_log*log,u64val)
510505
{
511506
structintel_guc*guc=log_to_guc(log);
@@ -521,7 +516,7 @@ int intel_guc_log_level_set(struct intel_guc_log *log, u64 val)
521516
* as indication that logging should be disabled.
522517
*/
523518
if (val<GUC_LOG_LEVEL_DISABLED||
524-
val>VERBOSITY_TO_LOG_LEVEL(GUC_LOG_VERBOSITY_MAX))
519+
val>GUC_VERBOSITY_TO_LOG_LEVEL(GUC_LOG_VERBOSITY_MAX))
525520
return-EINVAL;
526521

527522
mutex_lock(&dev_priv->drm.struct_mutex);
@@ -532,8 +527,9 @@ int intel_guc_log_level_set(struct intel_guc_log *log, u64 val)
532527
}
533528

534529
intel_runtime_pm_get(dev_priv);
535-
ret=guc_log_control(guc,LOG_LEVEL_TO_ENABLED(val),
536-
LOG_LEVEL_TO_VERBOSITY(val));
530+
ret=guc_log_control(guc,GUC_LOG_LEVEL_TO_VERBOSE(val),
531+
GUC_LOG_LEVEL_TO_ENABLED(val),
532+
GUC_LOG_LEVEL_TO_VERBOSITY(val));
537533
intel_runtime_pm_put(dev_priv);
538534
if (ret) {
539535
DRM_DEBUG_DRIVER("guc_log_control action failed %d\n",ret);

‎drivers/gpu/drm/i915/intel_guc_log.h‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,21 @@ struct intel_guc;
4040
#defineGUC_LOG_SIZE((1 + GUC_LOG_DPC_PAGES + 1 + GUC_LOG_ISR_PAGES + \
4141
1 + GUC_LOG_CRASH_PAGES + 1) << PAGE_SHIFT)
4242

43+
/*
44+
* While we're using plain log level in i915, GuC controls are much more...
45+
* "elaborate"? We have a couple of bits for verbosity, separate bit for actual
46+
* log enabling, and separate bit for default logging - which "conveniently"
47+
* ignores the enable bit.
48+
*/
49+
#defineGUC_LOG_LEVEL_DISABLED0
50+
#defineGUC_LOG_LEVEL_TO_ENABLED(x)((x) > 0)
51+
#defineGUC_LOG_LEVEL_TO_VERBOSE(x)((x) > 1)
52+
#defineGUC_LOG_LEVEL_TO_VERBOSITY(x) ({\
53+
typeof(x) _x = (x);\
54+
GUC_LOG_LEVEL_TO_VERBOSE(_x) ? _x - 2 : 0;\
55+
})
56+
#defineGUC_VERBOSITY_TO_LOG_LEVEL(x)((x) + 2)
57+
4358
structintel_guc_log {
4459
u32flags;
4560
structi915_vma*vma;

‎drivers/gpu/drm/i915/intel_uc.c‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ static int __get_default_guc_log_level(struct drm_i915_private *dev_priv)
7575
if (HAS_GUC(dev_priv)&&intel_uc_is_using_guc()&&
7676
(IS_ENABLED(CONFIG_DRM_I915_DEBUG)||
7777
IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM)))
78-
guc_log_level=1+GUC_LOG_VERBOSITY_MAX;
78+
guc_log_level=
79+
GUC_VERBOSITY_TO_LOG_LEVEL(GUC_LOG_VERBOSITY_MAX);
7980

8081
/* Any platform specific fine-tuning can be done here */
8182

@@ -142,17 +143,20 @@ static void sanitize_options_early(struct drm_i915_private *dev_priv)
142143
i915_modparams.guc_log_level=0;
143144
}
144145

145-
if (i915_modparams.guc_log_level>1+GUC_LOG_VERBOSITY_MAX) {
146+
if (i915_modparams.guc_log_level>
147+
GUC_VERBOSITY_TO_LOG_LEVEL(GUC_LOG_VERBOSITY_MAX)) {
146148
DRM_WARN("Incompatible option detected: %s=%d, %s!\n",
147149
"guc_log_level",i915_modparams.guc_log_level,
148150
"verbosity too high");
149-
i915_modparams.guc_log_level=1+GUC_LOG_VERBOSITY_MAX;
151+
i915_modparams.guc_log_level=
152+
GUC_VERBOSITY_TO_LOG_LEVEL(GUC_LOG_VERBOSITY_MAX);
150153
}
151154

152-
DRM_DEBUG_DRIVER("guc_log_level=%d (enabled:%s verbosity:%d)\n",
155+
DRM_DEBUG_DRIVER("guc_log_level=%d (enabled:%s, verbose:%s, verbosity:%d)\n",
153156
i915_modparams.guc_log_level,
154157
yesno(i915_modparams.guc_log_level),
155-
i915_modparams.guc_log_level-1);
158+
yesno(GUC_LOG_LEVEL_TO_VERBOSE(i915_modparams.guc_log_level)),
159+
GUC_LOG_LEVEL_TO_VERBOSITY(i915_modparams.guc_log_level));
156160

157161
/* Make sure that sanitization was done */
158162
GEM_BUG_ON(i915_modparams.enable_guc<0);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp