Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] tests/gem_seqno_wrap: verify debugfs write with readback
@ 2013-04-11 13:11 Mika Kuoppala
  2013-04-11 15:27 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Mika Kuoppala @ 2013-04-11 13:11 UTC (permalink / raw)
  To: intel-gfx

Make sure that debugfs entry works as expected by reading
back the sequence number that was written.

Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>
---
 tests/gem_seqno_wrap.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c
index 43e3851..776dedc 100644
--- a/tests/gem_seqno_wrap.c
+++ b/tests/gem_seqno_wrap.c
@@ -438,6 +438,7 @@ static int write_seqno(uint32_t seqno)
 	int fh;
 	char buf[32];
 	int r;
+	uint32_t rb;
 
 	if (options.dontwrap)
 		return 0;
@@ -457,6 +458,15 @@ static int write_seqno(uint32_t seqno)
 	if (options.verbose)
 		printf("next_seqno set to: 0x%x\n", seqno);
 
+	r = __read_seqno(&rb);
+	if (r < 0)
+		return r;
+
+	if (rb != seqno) {
+		printf("seqno readback differs rb:0x%x vs w:0x%x\n", rb, seqno);
+		return -1;
+	}
+
 	return 0;
 }
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] tests/gem_seqno_wrap: verify debugfs write with readback
  2013-04-11 13:11 [PATCH 1/1] tests/gem_seqno_wrap: verify debugfs write with readback Mika Kuoppala
@ 2013-04-11 15:27 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2013-04-11 15:27 UTC (permalink / raw)
  To: Mika Kuoppala; +Cc: intel-gfx

On Thu, Apr 11, 2013 at 04:11:28PM +0300, Mika Kuoppala wrote:
> Make sure that debugfs entry works as expected by reading
> back the sequence number that was written.
> 
> Signed-off-by: Mika Kuoppala <mika.kuoppala@intel.com>

Merged, thanks.
-Daniel
> ---
>  tests/gem_seqno_wrap.c |   10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/tests/gem_seqno_wrap.c b/tests/gem_seqno_wrap.c
> index 43e3851..776dedc 100644
> --- a/tests/gem_seqno_wrap.c
> +++ b/tests/gem_seqno_wrap.c
> @@ -438,6 +438,7 @@ static int write_seqno(uint32_t seqno)
>  	int fh;
>  	char buf[32];
>  	int r;
> +	uint32_t rb;
>  
>  	if (options.dontwrap)
>  		return 0;
> @@ -457,6 +458,15 @@ static int write_seqno(uint32_t seqno)
>  	if (options.verbose)
>  		printf("next_seqno set to: 0x%x\n", seqno);
>  
> +	r = __read_seqno(&rb);
> +	if (r < 0)
> +		return r;
> +
> +	if (rb != seqno) {
> +		printf("seqno readback differs rb:0x%x vs w:0x%x\n", rb, seqno);
> +		return -1;
> +	}
> +
>  	return 0;
>  }
>  
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-04-11 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-11 13:11 [PATCH 1/1] tests/gem_seqno_wrap: verify debugfs write with readback Mika Kuoppala
2013-04-11 15:27 ` Daniel Vetter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox