<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <div class="moz-cite-prefix">On 6/16/2025 11:52 AM, Lucas De Marchi
      wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:jfkgpylqiujyudvqr4ivn3653arznibeofzqrdyhiy4fv3tgsk@tjf4hde4izg3">On
      Mon, Jun 16, 2025 at 11:46:57AM -0700, John Harrison wrote:
      <br>
      <blockquote type="cite">On 6/13/2025 1:00 PM, Lucas De Marchi
        wrote:
        <br>
        <blockquote type="cite">Document xe module params with the
          default values following a similar
          <br>
          strategy for all of them:
          <br>
          <br>
              1) Define a DEFAULT_* macro with the default value. When
          the
          <br>
                 value can't be directly stringified, also define a
          *_STR
          <br>
                 variant
          <br>
              2) Use __stringify() or the _STR variant to make sure the
          <br>
                 default value shows up in the param description
          <br>
          <br>
          This allows us to show the correct default according to the
          <br>
          configuration. max_vfs for example was wrongly documented for
          <br>
          CONFIG_DRM_XE_DEBUG and svm_notifier_size didn't have its
          default
          <br>
          documented.
          <br>
          <br>
          Signed-off-by: Lucas De Marchi
          <a class="moz-txt-link-rfc2396E" href="mailto:lucas.demarchi@intel.com"><lucas.demarchi@intel.com></a>
          <br>
          ---
          <br>
           drivers/gpu/drm/xe/xe_module.c | 44
          +++++++++++++++++++++++++++---------------
          <br>
           1 file changed, 28 insertions(+), 16 deletions(-)
          <br>
          <br>
          diff --git a/drivers/gpu/drm/xe/xe_module.c
          b/drivers/gpu/drm/xe/xe_module.c
          <br>
          index 192908fa074cb..2068c579d5c3b 100644
          <br>
          --- a/drivers/gpu/drm/xe/xe_module.c
          <br>
          +++ b/drivers/gpu/drm/xe/xe_module.c
          <br>
          @@ -19,34 +19,43 @@
          <br>
           #include "xe_sched_job.h"
          <br>
           #if IS_ENABLED(CONFIG_DRM_XE_DEBUG)
          <br>
          -#define DEFAULT_GUC_LOG_LEVEL    3
          <br>
          +#define DEFAULT_GUC_LOG_LEVEL        3
          <br>
          +#define DEFAULT_MAX_VFS            ~0
          <br>
          +#define DEFAULT_MAX_VFS_STR        "unlimited"
          <br>
           #else
          <br>
          -#define DEFAULT_GUC_LOG_LEVEL    1
          <br>
          +#define DEFAULT_GUC_LOG_LEVEL        1
          <br>
          +#define DEFAULT_MAX_VFS            0
          <br>
          +#define DEFAULT_MAX_VFS_STR        "0"
          <br>
        </blockquote>
        Could be 'stringify(MAX_VFS)'.
        <br>
      </blockquote>
      <br>
      I think it's better to pair with the one above.
      <br>
      We don't want to print the the default is ~0 in the other case so
      we
      <br>
      create a manual _STR.
      <br>
    </blockquote>
    <br>
    I meant:<br>
    <blockquote>#define DEFAULT_MAX_VFS            ~0<br>
      #define DEFAULT_MAX_VFS_STR        "unlimited"<br>
      #else<br>
      #define DEFAULT_MAX_VFS            0<br>
      #define DEFAULT_MAX_VFS_STR        __stringify(DEFAULT_MAX_VFS)<br>
    </blockquote>
    <br>
    John.<br>
    <br>
    <blockquote type="cite" cite="mid:jfkgpylqiujyudvqr4ivn3653arznibeofzqrdyhiy4fv3tgsk@tjf4hde4izg3">
      <br>
      <br>
      <blockquote type="cite">
        <br>
        <blockquote type="cite"> #endif
          <br>
          +#define DEFAULT_PROBE_DISPLAY        true
          <br>
          +#define DEFAULT_FORCE_PROBE        CONFIG_DRM_XE_FORCE_PROBE
          <br>
          +#define DEFAULT_WEDGED_MODE        1
          <br>
          +#define DEFAULT_SVM_NOTIFIER_SIZE    512
          <br>
          +
          <br>
           struct xe_modparam xe_modparam = {
          <br>
          -    .probe_display = true,
          <br>
          -    .guc_log_level = DEFAULT_GUC_LOG_LEVEL,
          <br>
          -    .force_probe = CONFIG_DRM_XE_FORCE_PROBE,
          <br>
          -#ifdef CONFIG_PCI_IOV
          <br>
        </blockquote>
        This ifdef is lost from the new version?
        <br>
      </blockquote>
      <br>
      yeah, dropped it by mistake... will need to add it back.
      <br>
      <blockquote type="cite">
        <br>
        <blockquote type="cite">-    .max_vfs =
          IS_ENABLED(CONFIG_DRM_XE_DEBUG) ? ~0 : 0,
          <br>
          -#endif
          <br>
          -    .wedged_mode = 1,
          <br>
          -    .svm_notifier_size = 512,
          <br>
          +    .probe_display =    DEFAULT_PROBE_DISPLAY,
          <br>
          +    .guc_log_level =    DEFAULT_GUC_LOG_LEVEL,
          <br>
          +    .force_probe =        DEFAULT_FORCE_PROBE,
          <br>
          +    .max_vfs =        DEFAULT_MAX_VFS,
          <br>
          +    .wedged_mode =        DEFAULT_WEDGED_MODE,
          <br>
          +    .svm_notifier_size =    DEFAULT_SVM_NOTIFIER_SIZE,
          <br>
               /* the rest are 0 by default */
          <br>
           };
          <br>
           module_param_named(svm_notifier_size,
          xe_modparam.svm_notifier_size, uint, 0600);
          <br>
          -MODULE_PARM_DESC(svm_notifier_size, "Set the svm notifier
          size(in MiB), must be power of 2");
          <br>
          +MODULE_PARM_DESC(svm_notifier_size, "Set the svm notifier
          size in MiB, must be power of 2 "
          <br>
          +         "[default=" __stringify(DEFAULT_SVM_NOTIFIER_SIZE)
          "]");
          <br>
           module_param_named_unsafe(force_execlist,
          xe_modparam.force_execlist, bool, 0444);
          <br>
           MODULE_PARM_DESC(force_execlist, "Force Execlist
          submission");
          <br>
           module_param_named(probe_display, xe_modparam.probe_display,
          bool, 0444);
          <br>
          -MODULE_PARM_DESC(probe_display, "Probe display HW, otherwise
          it's left untouched (default: true)");
          <br>
          +MODULE_PARM_DESC(probe_display, "Probe display HW, otherwise
          it's left untouched "
          <br>
          +         "[default=" __stringify(DEFAULT_PROBE_DISPLAY)
          "])");
          <br>
           module_param_named(vram_bar_size,
          xe_modparam.force_vram_bar_size, int, 0600);
          <br>
          -MODULE_PARM_DESC(vram_bar_size, "Set the vram bar size (in
          MiB) - <0=disable-resize, 0=max-needed-size[default],
          >0=force-size");
          <br>
          +MODULE_PARM_DESC(vram_bar_size, "Set the vram bar size in MiB
          (<0=disable-resize, 0=max-needed-size, >0=force-size
          [default=0])");
          <br>
        </blockquote>
        Why leave this one as hard coded value rather than a define?
        <br>
      </blockquote>
      <br>
      there wasn't an assignment xe_modparam, so I overlooked it. I will
      fix
      <br>
      those up in next rev
      <br>
      <br>
      thanks
      <br>
      Lucas De Marchi
      <br>
      <br>
      <br>
      <blockquote type="cite">
        <br>
        John.
        <br>
        <br>
        <blockquote type="cite"> module_param_named(guc_log_level,
          xe_modparam.guc_log_level, int, 0600);
          <br>
           MODULE_PARM_DESC(guc_log_level, "GuC firmware logging level
          (0=disable, 1=normal, 2..5=verbose-levels "
          <br>
          @@ -66,18 +75,21 @@ MODULE_PARM_DESC(gsc_firmware_path,
          <br>
           module_param_named_unsafe(force_probe,
          xe_modparam.force_probe, charp, 0400);
          <br>
           MODULE_PARM_DESC(force_probe,
          <br>
          -         "Force probe options for specified devices. See
          CONFIG_DRM_XE_FORCE_PROBE for details.");
          <br>
          +         "Force probe options for specified devices. See
          CONFIG_DRM_XE_FORCE_PROBE for details "
          <br>
          +         "[default=" DEFAULT_FORCE_PROBE "])");
          <br>
           #ifdef CONFIG_PCI_IOV
          <br>
           module_param_named(max_vfs, xe_modparam.max_vfs, uint, 0400);
          <br>
           MODULE_PARM_DESC(max_vfs,
          <br>
                    "Limit number of Virtual Functions (VFs) that could
          be managed. "
          <br>
          -         "(0 = no VFs [default]; N = allow up to N VFs)");
          <br>
          +         "(0=no VFs; N=allow up to N VFs "
          <br>
          +         "[default=" DEFAULT_MAX_VFS_STR "])");
          <br>
           #endif
          <br>
           module_param_named_unsafe(wedged_mode,
          xe_modparam.wedged_mode, int, 0600);
          <br>
           MODULE_PARM_DESC(wedged_mode,
          <br>
          -         "Module's default policy for the wedged mode -
          0=never, 1=upon-critical-errors[default], 2=upon-any-hang");
          <br>
          +         "Module's default policy for the wedged mode
          (0=never, 1=upon-critical-errors, 2=upon-any-hang "
          <br>
          +         "[default=" __stringify(DEFAULT_WEDGED_MODE) "])");
          <br>
           static int xe_check_nomodeset(void)
          <br>
           {
          <br>
          <br>
        </blockquote>
        <br>
      </blockquote>
    </blockquote>
    <br>
  </body>
</html>