From: Mika Kuoppala Date: Thu, 11 Apr 2013 13:11:28 +0000 (+0300) Subject: tests/gem_seqno_wrap: verify debugfs write with readback X-Git-Tag: intel-gpu-tools-1.4~436 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a7ca33b673ee90b0a93ffdb18449256798f67786;p=platform%2Fupstream%2Fintel-gpu-tools.git tests/gem_seqno_wrap: verify debugfs write with readback Make sure that debugfs entry works as expected by reading back the sequence number that was written. Signed-off-by: Mika Kuoppala Signed-off-by: Daniel Vetter --- 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; }