From: Jani Nikula <jani.nikula@intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH v2] drm/i915: Reduce ELD hex dumps a bit
Date: Wed, 15 Feb 2023 17:13:13 +0200 [thread overview]
Message-ID: <87a61fq7w6.fsf@intel.com> (raw)
In-Reply-To: <20230215150129.13288-1-ville.syrjala@linux.intel.com>
On Wed, 15 Feb 2023, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Do the ELD hexdumps only up to the last differing byte.
> The rest is typically all zeroes anyway so not much point
> in dumping it.
>
> Couldn't find anything for memcmp_diff_len() so
> rolled my own.
>
> v2: Use semantics and function name suggested by Jani
>
> Cc: Jani Nikula <jani.nikula@intel.com>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
> ---
> drivers/gpu/drm/i915/display/intel_display.c | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
> index 3479125fbda6..664322a58236 100644
> --- a/drivers/gpu/drm/i915/display/intel_display.c
> +++ b/drivers/gpu/drm/i915/display/intel_display.c
> @@ -5348,6 +5348,20 @@ pipe_config_dp_vsc_sdp_mismatch(struct drm_i915_private *dev_priv,
> }
> }
>
> +/* Returns the length up to and including the last differing byte */
> +static size_t
> +memcmp_diff_len(const u8 *a, const u8 *b, size_t len)
> +{
> + int i;
> +
> + for (i = len - 1; i >= 0; i--) {
> + if (a[i] != b[i])
> + return i + 1;
> + }
> +
> + return 0;
> +}
> +
> static void
> pipe_config_buffer_mismatch(struct drm_i915_private *dev_priv,
> bool fastset, const char *name,
> @@ -5357,6 +5371,9 @@ pipe_config_buffer_mismatch(struct drm_i915_private *dev_priv,
> if (!drm_debug_enabled(DRM_UT_KMS))
> return;
>
> + /* only dump up to the last difference */
> + len = memcmp_diff_len(a, b, len);
> +
> drm_dbg_kms(&dev_priv->drm,
> "fastset mismatch in %s buffer\n", name);
> print_hex_dump(KERN_DEBUG, "expected: ", DUMP_PREFIX_NONE,
> @@ -5364,6 +5381,9 @@ pipe_config_buffer_mismatch(struct drm_i915_private *dev_priv,
> print_hex_dump(KERN_DEBUG, "found: ", DUMP_PREFIX_NONE,
> 16, 0, b, len, false);
> } else {
> + /* only dump up to the last difference */
> + len = memcmp_diff_len(a, b, len);
> +
> drm_err(&dev_priv->drm, "mismatch in %s buffer\n", name);
> print_hex_dump(KERN_ERR, "expected: ", DUMP_PREFIX_NONE,
> 16, 0, a, len, false);
--
Jani Nikula, Intel Open Source Graphics Center
next prev parent reply other threads:[~2023-02-15 15:14 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-15 12:18 [Intel-gfx] [PATCH] drm/i915: Reduce ELD hex dumps a bit Ville Syrjala
2023-02-15 13:12 ` [Intel-gfx] ✓ Fi.CI.BAT: success for " Patchwork
2023-02-15 13:15 ` [Intel-gfx] [PATCH] " Jani Nikula
2023-02-15 13:19 ` Ville Syrjälä
2023-02-15 14:17 ` Jani Nikula
2023-02-15 15:01 ` [Intel-gfx] [PATCH v2] " Ville Syrjala
2023-02-15 15:13 ` Jani Nikula [this message]
2023-02-15 19:33 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915: Reduce ELD hex dumps a bit (rev2) Patchwork
2023-02-16 15:04 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
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=87a61fq7w6.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.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.