From 04ccba4d40bef6cee902b118598272f26eebb1df Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Wed, 16 Mar 2005 12:16:06 +0000 Subject: [PATCH] Don't fail calling function when DriverFunc() for RandR fails as DriverFunc() also returns FALSE when the specific sub function isn't supported. In the case of xf86RandRGetInfo() we simply rely on what has been set before and return TRUE. In the case of xf86RandRSetConfig() we only bail with FALSE if we have to do a rotation and the call fails. We presently cannot do rotation on the fly without the help of a driver function (Bugzilla #2745). --- hw/xfree86/common/xf86RandR.c | 37 +++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/hw/xfree86/common/xf86RandR.c b/hw/xfree86/common/xf86RandR.c index ba7127d75..f69faec96 100644 --- a/hw/xfree86/common/xf86RandR.c +++ b/hw/xfree86/common/xf86RandR.c @@ -1,4 +1,4 @@ -/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.6 2004/12/04 00:42:52 kuhn Exp $ */ +/* $XdotOrg: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.7 2005/01/28 16:12:59 eich Exp $ */ /* * $XFree86: xc/programs/Xserver/hw/xfree86/common/xf86RandR.c,v 1.7tsi Exp $ * @@ -109,7 +109,7 @@ xf86RandRGetInfo (ScreenPtr pScreen, Rotation *rotations) RRRotation.RRRotations = *rotations; if (!(*scrp->DriverFunc)(scrp, RR_GET_INFO, &RRRotation)) - return FALSE; + return TRUE; *rotations = RRRotation.RRRotations; } @@ -193,8 +193,6 @@ xf86RandRSetConfig (ScreenPtr pScreen, int px, py; Bool useVirtual = FALSE; - randrp->rotation = rotation; - miPointerPosition (&px, &py); for (mode = scrp->modes; ; mode = mode->next) { @@ -215,18 +213,27 @@ xf86RandRSetConfig (ScreenPtr pScreen, } } - /* Have the driver do its thing. */ - if (scrp->DriverFunc) { - xorgRRRotation RRRotation; - RRRotation.RRConfig.rotation = rotation; - RRRotation.RRConfig.rate = rate; - RRRotation.RRConfig.width = pSize->width; - RRRotation.RRConfig.height = pSize->height; - - if (!(*scrp->DriverFunc)(scrp, RR_SET_CONFIG, &RRRotation)) - return FALSE; - } + if (randrp->rotation != rotation) { + /* Have the driver do its thing. */ + if (scrp->DriverFunc) { + xorgRRRotation RRRotation; + RRRotation.RRConfig.rotation = rotation; + RRRotation.RRConfig.rate = rate; + RRRotation.RRConfig.width = pSize->width; + RRRotation.RRConfig.height = pSize->height; + + /* + * Currently we need to rely on HW support for rotation. + */ + if (!(*scrp->DriverFunc)(scrp, RR_SET_CONFIG, &RRRotation)) + return FALSE; + } else + return FALSE; + + randrp->rotation = rotation; + } + if (!xf86RandRSetMode (pScreen, mode, useVirtual, pSize->mmWidth, pSize->mmHeight)) return FALSE; /*