Re: [PATCH 3/3] drm/i915/debugfs: Highlight modified i915 params

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Michal Wajdeczko (2017-06-08 16:07:34)
> We know default values for all params and we know which params are safe
> to change. Mark params that were changed when dumping them in debugfs.
> 
> Suggested-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@xxxxxxxxx>
> Cc: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/i915_debugfs.c | 53 ++++++++++++++++++++++++++++---------
>  1 file changed, 41 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 7a2f0b8..4dc5e8f 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -35,20 +35,42 @@ static inline struct drm_i915_private *node_to_i915(struct drm_info_node *node)
>         return to_i915(node->minor->dev);
>  }
>  
> +static inline const char *param_diagnostic(bool is_default, bool is_unsafe)
> +{
> +       if (is_default)
> +               return "";
> +       if (is_unsafe)
> +               return " [modified *unsafe*]";
> +       return " [modified]";

There's one more complication here: those parameters that are
automatically reset based on HW support. Probably not worth it since how
do we tell the difference (between the driver adjustment and user),
without support of modparam tracking. :|

> +       } else if (!__builtin_strcmp(type, "charp")) {
> +               const char *new = *(const char **)x;
> +               const char *old = *(const char **)v;
> +               bool is_default = old ? new ? !strcmp(old, new) : false :
> +                                 new ? false : true;

is_default = old && new ? !strcmp(old, new) : old == new; ?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux