On 01/31/2011 06:08 PM, Michel Dänzer wrote:
On Mon, 2011-01-31 at 15:48 +0200, Rami Ylimäki wrote:
Signed-off-by: Rami Ylimäki<[email protected]>
---
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.
Do you mean that XGetImage is also called elsewhere in x11perf and the
patch doesn't touch those locations?
The XGetImage call in InitGetImage is the only one that is done with
invalid parameters causing a BadMatch error. With this patch, I'm able
to run x11perf with all tests without terminating prematurely because of
an X error. I have tested this with a device that has a small screen and
also with Xephyr using a small window.
-- Rami
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel