diff mbox

[3/5] drm/i915: Make the hexdump row offset visually distinct

Message ID 20180613145901.29306-3-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson June 13, 2018, 2:58 p.m. UTC
Currently we use %08x for the row offset, and %08x for the binary
contents of the buffer. This makes it very easily to confuse the two, so
switch to using [%04x] for the start-of-row offset.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/intel_engine_cs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Mika Kuoppala June 14, 2018, 3:16 p.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> Currently we use %08x for the row offset, and %08x for the binary
> contents of the buffer. This makes it very easily to confuse the two, so
> switch to using [%04x] for the start-of-row offset.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/intel_engine_cs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index d7f757fb8401..875bd466f3bf 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -1258,7 +1258,7 @@ static void hexdump(struct drm_printer *m, const void *buf, size_t len)
>  						rowsize, sizeof(u32),
>  						line, sizeof(line),
>  						false) >= sizeof(line));
> -		drm_printf(m, "%08zx %s\n", pos, line);
> +		drm_printf(m, "[%04zx] %s\n", pos, line);
>  
>  		prev = buf + pos;
>  		skip = false;
> -- 
> 2.17.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index d7f757fb8401..875bd466f3bf 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -1258,7 +1258,7 @@  static void hexdump(struct drm_printer *m, const void *buf, size_t len)
 						rowsize, sizeof(u32),
 						line, sizeof(line),
 						false) >= sizeof(line));
-		drm_printf(m, "%08zx %s\n", pos, line);
+		drm_printf(m, "[%04zx] %s\n", pos, line);
 
 		prev = buf + pos;
 		skip = false;