From bbc193692cd1bba44f11d9f2ee53196c634c7b40 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 22 Oct 2012 08:54:19 +0100 Subject: [PATCH 1/2] XVidMode: Do not abort SwitchTo if no currentMode is set Whilst it should be impossible to have no currentMode and yet a list of modes to iterate over, conceptually there is nothing preventing SwitchTo from failing if there is no currentMode set. References: https://bugs.freedesktop.org/show_bug.cgi?id=55864 Signed-off-by: Chris Wilson --- hw/xfree86/common/xf86vmode.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/common/xf86vmode.c b/hw/xfree86/common/xf86vmode.c index cad0e6a..08ef4cd 100644 --- a/hw/xfree86/common/xf86vmode.c +++ b/hw/xfree86/common/xf86vmode.c @@ -1135,10 +1135,8 @@ ProcXF86VidModeSwitchToMode(ClientPtr client) if (stuff->screen >= screenInfo.numScreens) return BadValue; - if (!VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock)) - return BadValue; - - if ((VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock) + if (VidModeGetCurrentModeline(stuff->screen, &mode, &dotClock) + && VidModeGetDotClock(stuff->screen, stuff->dotclock) == dotClock && MODEMATCH(mode, stuff)) return Success; -- 1.7.10.4