All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Wilson <chris@chris-wilson.co.uk>
To: Michal Wajdeczko <michal.wajdeczko@intel.com>,
	intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH 3/3] drm/i915/debugfs: Highlight modified i915 params
Date: Thu, 08 Jun 2017 16:25:03 +0100	[thread overview]
Message-ID: <149693550310.22093.15818172890620482433@mail.alporthouse.com> (raw)
In-Reply-To: <20170608150734.42296-4-michal.wajdeczko@intel.com>

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@chris-wilson.co.uk>
> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
> Cc: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  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@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2017-06-08 15:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-08 15:07 [PATCH 0/3] drm/i915: Misc improvements around module params Michal Wajdeczko
2017-06-08 15:07 ` [PATCH 1/3] drm/i915: Rename i915.panel_use_ssc field to lvds_use_ssc Michal Wajdeczko
2017-06-08 16:03   ` Ville Syrjälä
2017-06-08 16:22     ` Michal Wajdeczko
2017-06-08 20:00       ` Chris Wilson
2017-06-08 15:07 ` [PATCH 2/3] drm/i915: Extend PARAMS_FOR_EACH macro with more data Michal Wajdeczko
2017-06-08 15:07 ` [PATCH 3/3] drm/i915/debugfs: Highlight modified i915 params Michal Wajdeczko
2017-06-08 15:25   ` Chris Wilson [this message]
2017-06-08 15:26 ` ✓ Fi.CI.BAT: success for drm/i915: Misc improvements around module params Patchwork
2017-06-08 15:41 ` [PATCH v2 3/3] drm/i915/debugfs: Highlight modified i915 params Michal Wajdeczko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=149693550310.22093.15818172890620482433@mail.alporthouse.com \
    --to=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=michal.wajdeczko@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.