Skip to content

Commit

Permalink
9.17-2 patchset
Browse files Browse the repository at this point in the history
workaround Xwayland fps lock for AMD and re-add some patches that weren't actually causing issues
  • Loading branch information
whrvt committed Sep 10, 2024
1 parent 25f4ac4 commit 00b542d
Show file tree
Hide file tree
Showing 15 changed files with 1,237 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@ diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index 11111111111..11111111111 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1791,7 +1791,10 @@ Window get_dummy_parent(void)
@@ -1791,7 +1791,9 @@ Window get_dummy_parent(void)
attrib.colormap = default_colormap;

#ifdef HAVE_LIBXSHAPE
+ const char *override_env = getenv("WINE_XWAYLAND_FPS_LOCK_WORKAROUND");
+ if (!wm_is_mutter( gdi_display ) && !(override_env && *override_env != '\0' && *override_env != '0'))
+ if (!wm_is_mutter( gdi_display ))
{
+ TRACE("Not using Xshape fallback, WM isn't Mutter.\n");
static XRectangle empty_rect;
dummy_parent = XCreateWindow( gdi_display, root_window, 0, 0, 1, 1, 0,
default_visual.depth, InputOutput, default_visual.visual,
@@ -1799,11 +1802,15 @@ Window get_dummy_parent(void)
@@ -1799,11 +1801,15 @@ Window get_dummy_parent(void)
XShapeCombineRectangles( gdi_display, dummy_parent, ShapeBounding, 0, 0, &empty_rect, 1,
ShapeSet, YXBanded );
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From 1d3ea526ce3be6afcf009c338c2500fb1a1b28fc Mon Sep 17 00:00:00 2001
From: William Horvath <[email protected]>
Date: Tue, 10 Sep 2024 07:23:38 -0700
Subject: [PATCH] winex11: Force disable glXWaitForSbcOML (AMD) on Wayland to
circumvent Xwayland locking FPS to the monitor's refresh rate.

It should only break ingame vsync, but WINE_XWAYLAND_FPS_LOCK_WORKAROUND=0 can override-disable this behavior.
---
dlls/winex11.drv/opengl.c | 3 ++-
dlls/winex11.drv/x11drv.h | 12 ++++++++++++
2 files changed, 14 insertions(+), 1 deletion(-)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index b6c73b8d0af..aaa9956808d 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -714,7 +714,8 @@ static void init_opengl(void)

if (has_extension( glxExtensions, "GLX_OML_sync_control" ))
{
- pglXWaitForSbcOML = pglXGetProcAddressARB( (const GLubyte *)"glXWaitForSbcOML" );
+ if (!disable_glXWaitForSbcOML())
+ pglXWaitForSbcOML = pglXGetProcAddressARB( (const GLubyte *)"glXWaitForSbcOML" );
pglXSwapBuffersMscOML = pglXGetProcAddressARB( (const GLubyte *)"glXSwapBuffersMscOML" );
}

diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h
index 00c54b19767..d967c721499 100644
--- a/dlls/winex11.drv/x11drv.h
+++ b/dlls/winex11.drv/x11drv.h
@@ -944,7 +944,19 @@ static inline BOOL intersect_rect( RECT *dst, const RECT *src1, const RECT *src2
dst->bottom = min( src1->bottom, src2->bottom );
return !IsRectEmpty( dst );
}
+static inline BOOL disable_glXWaitForSbcOML(void)
+{
+ const char *override_env = getenv("vblank_mode");
+ if (override_env)
+ if (*override_env != '\0' && *override_env != '0')
+ return FALSE;
+ else
+ return TRUE;
+
+ if (!getenv("WAYLAND_DISPLAY")) return FALSE;

+ return TRUE;
+}
/* registry helpers */

extern HKEY open_hkcu_key( const char *name );
--
2.46.0

Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,22 @@ index 11111111111..11111111111 100644

gl->drawable = pglXCreateWindow( gdi_display, gl->format->fbconfig, gl->window, NULL );
- pXCompositeRedirectWindow( gdi_display, gl->window, CompositeRedirectManual );
+ if (!gl_disable_child_window_clipping) pXCompositeRedirectWindow( gdi_display, gl->window, CompositeRedirectManual );
+ if (usexcomposite) pXCompositeRedirectWindow( gdi_display, gl->window, CompositeRedirectManual );

if ((data = get_win_data( hwnd )))
{
@@ -1299,6 +1306,9 @@ static BOOL set_pixel_format( HDC hdc, int format, BOOL internal )
*/
void sync_gl_drawable( HWND hwnd, BOOL known_child )
{
+ /* Since we never have a known_child, this entire function is a no-op */
+ if (gl_disable_child_window_clipping) return;
+
struct gl_drawable *old, *new;

if (!(old = get_gl_drawable( hwnd, 0 ))) return;
@@ -1320,6 +1327,11 @@ void sync_gl_drawable( HWND hwnd, BOOL known_child )
if (!known_child) break; /* Still a childless top-level window */
/* fall through */
case DC_GL_PIXMAP_WIN:
+ if (gl_disable_child_window_clipping)
+ {
+ XFlush( gdi_display );
+ break;
+ }
if (!(new = create_gl_drawable( hwnd, old->format, known_child, old->mutable_pf ))) break;
mark_drawable_dirty( old, new );
XFlush( gdi_display );
diff --git a/dlls/winex11.drv/x11drv_main.c b/dlls/winex11.drv/x11drv_main.c
index 11111111111..11111111111 100644
--- a/dlls/winex11.drv/x11drv_main.c
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
From e285015e53896814701e1bb1ce9e675e29625097 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?R=C3=A9mi=20Bernon?= <[email protected]>
Date: Thu, 30 Nov 2023 17:29:05 +0100
Subject: [PATCH 0178/1562] winex11: Always synchronize gdi_display after
window creation.

---
dlls/winex11.drv/window.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c
index e68c4abdf93..696edd6675c 100644
--- a/dlls/winex11.drv/window.c
+++ b/dlls/winex11.drv/window.c
@@ -1759,7 +1759,6 @@ Window create_client_window( HWND hwnd, const XVisualInfo *visual, Colormap colo
cx = min( max( 1, data->rects.client.right - data->rects.client.left ), 65535 );
cy = min( max( 1, data->rects.client.bottom - data->rects.client.top ), 65535 );

- XSync( gdi_display, False ); /* make sure whole_window is known from gdi_display */
ret = data->client_window = XCreateWindow( gdi_display,
data->whole_window ? data->whole_window : dummy_parent,
x, y, cx, cy, 0, default_visual.depth, InputOutput,
@@ -2095,6 +2094,7 @@ static void create_whole_window( struct x11drv_win_data *data )
sync_window_opacity( data->display, data->whole_window, alpha, layered_flags );

XFlush( data->display ); /* make sure the window exists before we start painting to it */
+ XSync( gdi_display, False ); /* make sure whole_window is known from gdi_display */

done:
if (win_rgn) NtGdiDeleteObjectApp( win_rgn );
--
2.45.2

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
From 970f435f0158e7f7e91c71546ab03a3415f41ebd Mon Sep 17 00:00:00 2001
From: Paul Gofman <[email protected]>
Date: Tue, 30 Jan 2024 11:55:31 -0600
Subject: [PATCH 1241/1516] winex11.drv: Default swap interval to 0 for child
window drawables in create_gl_drawable().

CW-Bug-Id: #23329
---
dlls/winex11.drv/opengl.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/dlls/winex11.drv/opengl.c b/dlls/winex11.drv/opengl.c
index 43f87e11..af404540 100644
--- a/dlls/winex11.drv/opengl.c
+++ b/dlls/winex11.drv/opengl.c
@@ -1541,6 +1541,7 @@ static struct gl_drawable *create_gl_drawable( HWND hwnd, const struct wgl_pixel
(visual->class == PseudoColor || visual->class == GrayScale ||
visual->class == DirectColor) ? AllocAll : AllocNone );
gl->window = create_client_window( hwnd, visual, gl->colormap );
+ gl->swap_interval = 0;
if (gl->window)
{
gl->drawable = pglXCreateWindow( gdi_display, gl->format->fbconfig, gl->window, NULL );
--
2.44.0

Loading

0 comments on commit 00b542d

Please sign in to comment.