summaryrefslogtreecommitdiff
path: root/protocol
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2013-10-29 20:13:45 +0000
committerKristian Høgsberg <krh@bitplanet.net>2013-12-07 22:26:23 -0800
commit40c0c3f91eeb747b86df64579e3b3706cc5450af (patch)
tree6cb7746f09c17951a2aa67ad7385c60295c51fa2 /protocol
parent65a07f8aef9538602792b33cb33fe856708173c0 (diff)
downloadweston-40c0c3f91eeb747b86df64579e3b3706cc5450af.tar.gz
tests: Test whether a simple EGL main loop uses too many buffers
This adds a test that tries to simulate a simple game loop that would be like this: while (1) { draw_something(); eglSwapBuffers(); } In this case the test is relying on eglSwapBuffers to throttle to a sensible frame rate. The test then verifies that only 2 EGL buffers are used. This is done via a new request and event in the wayland-test protocol. Currently this causes 3 buffers to be created because the release event generated by the swap buffers is not processed by Mesa until it blocks for the frame complete event in the next swap buffers call, but that is too late. This can be fixed in Mesa by issuing a sync request after the swap buffers and blocking on it before deciding whether to allocate a new buffer.
Diffstat (limited to 'protocol')
-rw-r--r--protocol/wayland-test.xml7
1 files changed, 7 insertions, 0 deletions
diff --git a/protocol/wayland-test.xml b/protocol/wayland-test.xml
index 2993f087..18b66253 100644
--- a/protocol/wayland-test.xml
+++ b/protocol/wayland-test.xml
@@ -51,5 +51,12 @@
<arg name="x" type="fixed"/>
<arg name="y" type="fixed"/>
</event>
+ <request name="get_n_egl_buffers">
+ <!-- causes a n_egl_buffers event to be sent which reports how many
+ buffer objects are live for the client -->
+ </request>
+ <event name="n_egl_buffers">
+ <arg name="n" type="uint"/>
+ </event>
</interface>
</protocol>