From: Gabriel Ivăncescu gabrielopcode@gmail.com
Since we only need the id, and vkGetRandROutputDisplayEXT can be extremely expensive.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55500 Signed-off-by: Gabriel Ivăncescu gabrielopcode@gmail.com --- dlls/winex11.drv/display.c | 4 ++-- dlls/winex11.drv/x11drv.h | 2 +- dlls/winex11.drv/xinerama.c | 2 +- dlls/winex11.drv/xrandr.c | 9 ++------- 4 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index f46c320e89b..49475571f71 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -402,7 +402,7 @@ RECT get_host_primary_monitor_rect(void) RECT rect = {0};
/* The first monitor is always primary */ - if (host_handler.get_gpus(&gpus, &gpu_count) && gpu_count && + if (host_handler.get_gpus(&gpus, &gpu_count, FALSE) && gpu_count && host_handler.get_adapters(gpus[0].id, &adapters, &adapter_count) && adapter_count && host_handler.get_monitors(adapters[0].id, &monitors, &monitor_count) && monitor_count) rect = monitors[0].rc_monitor; @@ -529,7 +529,7 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage TRACE( "via %s\n", debugstr_a(host_handler.name) );
/* Initialize GPUs */ - if (!host_handler.get_gpus( &gpus, &gpu_count )) return FALSE; + if (!host_handler.get_gpus( &gpus, &gpu_count, TRUE )) return FALSE; TRACE("GPU count: %d\n", gpu_count);
for (gpu = 0; gpu < gpu_count; gpu++) diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 9ee6498a02e..8e233a051f4 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -777,7 +777,7 @@ struct x11drv_display_device_handler /* get_gpus will be called to get a list of GPUs. First GPU has to be where the primary adapter is. * * Return FALSE on failure with parameters unchanged */ - BOOL (*get_gpus)(struct gdi_gpu **gpus, int *count); + BOOL (*get_gpus)(struct gdi_gpu **gpus, int *count, BOOL get_properties);
/* get_adapters will be called to get a list of adapters in EnumDisplayDevices context under a GPU. * The first adapter has to be primary if GPU is primary. diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c index a508141d8c4..f0f831cbc1d 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -190,7 +190,7 @@ done: return ret; }
-static BOOL xinerama_get_gpus( struct gdi_gpu **new_gpus, int *count ) +static BOOL xinerama_get_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_properties ) { static const WCHAR wine_adapterW[] = {'W','i','n','e',' ','A','d','a','p','t','e','r',0}; struct gdi_gpu *gpus; diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 23601b9e75e..cf3f911cf5b 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -752,7 +752,7 @@ done:
/* Get a list of GPUs reported by XRandR 1.4. Set get_properties to FALSE if GPU properties are * not needed to avoid unnecessary querying */ -static BOOL xrandr14_get_gpus2( struct gdi_gpu **new_gpus, int *count, BOOL get_properties ) +static BOOL xrandr14_get_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_properties ) { static const WCHAR wine_adapterW[] = {'W','i','n','e',' ','A','d','a','p','t','e','r',0}; struct gdi_gpu *gpus = NULL; @@ -849,11 +849,6 @@ done: return ret; }
-static BOOL xrandr14_get_gpus( struct gdi_gpu **new_gpus, int *count ) -{ - return xrandr14_get_gpus2( new_gpus, count, TRUE ); -} - static void xrandr14_free_gpus( struct gdi_gpu *gpus ) { free( gpus ); @@ -1233,7 +1228,7 @@ static BOOL xrandr14_get_id( const WCHAR *device_name, BOOL is_primary, x11drv_s pthread_mutex_lock( &xrandr_mutex ); if (!current_modes) { - if (!xrandr14_get_gpus2( &gpus, &gpu_count, FALSE )) + if (!xrandr14_get_gpus( &gpus, &gpu_count, FALSE )) { pthread_mutex_unlock( &xrandr_mutex ); return FALSE;
This merge request was approved by Zhiyi Zhang.