[Piglit] [PATCH] util/x11: Don't spin when waiting for X events

Paul Berry stereotype441 at gmail.com
Thu May 30 15:59:42 PDT 2013


On 30 May 2013 15:57, Chad Versace <chad.versace at linux.intel.com> wrote:

> The nasty spin consumed 100% cpu when tests were ran in non-auto mode.
> No behavioral change when running tests in auto mode.
>
> This patch is semantically equivalent to:
>     while (true) {
> -       if (!XPending(dpy))
> -           continue;
>         XNextEvent(dpy, &event);
>         handle_event(event);
>     }
>

Reviewed-by: Paul Berry <stereotype441 at gmail.com>


>
> CC: Eric Anholt <eric at anholt.net>
> CC: Paul Berry <stereotype441 at gmail.com>
> Signed-off-by: Chad Versace <chad.versace at linux.intel.com>
> ---
>  tests/util/piglit-framework-gl/piglit_x11_framework.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/tests/util/piglit-framework-gl/piglit_x11_framework.c
> b/tests/util/piglit-framework-gl/piglit_x11_framework.c
> index dafd370..e4bf9b9 100644
> --- a/tests/util/piglit-framework-gl/piglit_x11_framework.c
> +++ b/tests/util/piglit-framework-gl/piglit_x11_framework.c
> @@ -80,9 +80,6 @@ process_next_event(struct piglit_x11_framework *x11_fw)
>         Display *dpy = x11_fw->display;
>         XEvent event;
>
> -       if (!XPending(dpy))
> -               return;
> -
>         XNextEvent(dpy, &event);
>
>         switch (event.type) {
> --
> 1.8.1.4
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130530/784f7c7b/attachment.html>


More information about the Piglit mailing list