From 2222607e81c884a1ad536cefa40d01150fec3e92 Mon Sep 17 00:00:00 2001 From: Zhiyi Zhang Date: Wed, 15 Jul 2020 20:38:41 +0800 Subject: [PATCH 01/35] winex11.drv: Avoid setting the same display mode in xrandr12_set_current_mode(). To: wine-devel@winehq.org XRRSetCrtcConfig() getting called with the same display mode as the current one may hang on some setups. Fix monitor tests timeout on Debian testing TestBot VMs. Signed-off-by: Zhiyi Zhang --- dlls/winex11.drv/xrandr.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 141c2ca17f6..53419548210 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -415,6 +415,12 @@ static LONG xrandr12_set_current_mode( int mode ) TRACE("CRTC %d: mode %#lx, %ux%u+%d+%d.\n", primary_crtc, crtc_info->mode, crtc_info->width, crtc_info->height, crtc_info->x, crtc_info->y); + if (xrandr12_modes[mode] == crtc_info->mode) + { + status = RRSetConfigSuccess; + goto done; + } + /* According to the RandR spec, the entire CRTC must fit inside the screen. * Since we use the union of all enabled CRTCs to determine the necessary * screen size, this might involve shrinking the screen, so we must disable @@ -452,6 +458,7 @@ static LONG xrandr12_set_current_mode( int mode ) XUngrabServer( gdi_display ); XFlush( gdi_display ); +done: pXRRFreeCrtcInfo( crtc_info ); pXRRFreeScreenResources( resources ); -- 2.25.1