[PATCH v2 x11perf 3/3] Omit benchmarks reading contents of window that is larger than screen.

Michel Dänzer michel at daenzer.net
Mon Jan 31 08:08:40 PST 2011


On Mon, 2011-01-31 at 15:48 +0200, Rami Ylimäki wrote: 
> Signed-off-by: Rami Ylimäki <rami.ylimaki at vincit.fi>
> ---
>  do_blt.c |   10 ++++++++++
>  1 files changed, 10 insertions(+), 0 deletions(-)
> 
> diff --git a/do_blt.c b/do_blt.c
> index 4be2836..fae9e1d 100644
> --- a/do_blt.c
> +++ b/do_blt.c
> @@ -208,6 +208,16 @@ InitCopyPix(XParms xp, Parms p, int reps)
>  int 
>  InitGetImage(XParms xp, Parms p, int reps)
>  {
> +    int screenWidth = DisplayWidth(xp->d, xp->vinfo.screen);
> +    int screenHeight = DisplayHeight(xp->d, xp->vinfo.screen);
> +
> +    if ((windowWidth > screenWidth) || (windowHeight > screenHeight))
> +    {
> +        printf("Can't read contents of %dx%d window on %dx%d screen, benchmark omitted\n",
> +               windowWidth, windowHeight, screenWidth, screenHeight);
> +        return False;
> +    }
> +

This will only catch tests which end up calling InitGetImage.


-- 
Earthling Michel Dänzer           |                http://www.vmware.com
Libre software enthusiast         |          Debian, X and DRI developer


More information about the xorg-devel mailing list