Skip to contentSkip to conversation

tests/gem_seqno_wrap: verify debugfs write with readback

PATCH Applied Mika Kuoppala 2 participants 2 messages Apr 11, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 tests/gem_seqno_wrap.c |   10 ++++++++++
 1 file changed, 10 insertions(+)
tests/gem_seqno_wrap.c +10 -0
index 43e3851..776dedc 100644
@@ -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;
 }
 
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 4 lines · Mika Kuoppala

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

Merged, thanks.
-Daniel

Quoted 39 lines
---
 tests/gem_seqno_wrap.c |   10 ++++++++++
 1 file changed, 10 insertions(+)
tests/gem_seqno_wrap.c +10 -0
index 43e3851..776dedc 100644
@@ -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;
 }
 
Signature · 6 lines
1.7.9.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch