Commit 88c1ef97 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

winex11: Avoid querying GPU properties in get_host_primary_monitor_rect.

Since we only need the id, and vkGetRandROutputDisplayEXT can be extremely expensive. Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55500Signed-off-by: 's avatarGabriel Ivăncescu <gabrielopcode@gmail.com>
parent 2cc573ae
...@@ -402,7 +402,7 @@ RECT get_host_primary_monitor_rect(void) ...@@ -402,7 +402,7 @@ RECT get_host_primary_monitor_rect(void)
RECT rect = {0}; RECT rect = {0};
/* The first monitor is always primary */ /* 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_adapters(gpus[0].id, &adapters, &adapter_count) && adapter_count &&
host_handler.get_monitors(adapters[0].id, &monitors, &monitor_count) && monitor_count) host_handler.get_monitors(adapters[0].id, &monitors, &monitor_count) && monitor_count)
rect = monitors[0].rc_monitor; rect = monitors[0].rc_monitor;
...@@ -529,7 +529,7 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage ...@@ -529,7 +529,7 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
TRACE( "via %s\n", debugstr_a(host_handler.name) ); TRACE( "via %s\n", debugstr_a(host_handler.name) );
/* Initialize GPUs */ /* 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); TRACE("GPU count: %d\n", gpu_count);
for (gpu = 0; gpu < gpu_count; gpu++) for (gpu = 0; gpu < gpu_count; gpu++)
......
...@@ -777,7 +777,7 @@ struct x11drv_display_device_handler ...@@ -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. /* 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 */ * 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. /* 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. * The first adapter has to be primary if GPU is primary.
......
...@@ -190,7 +190,7 @@ done: ...@@ -190,7 +190,7 @@ done:
return ret; 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}; static const WCHAR wine_adapterW[] = {'W','i','n','e',' ','A','d','a','p','t','e','r',0};
struct gdi_gpu *gpus; struct gdi_gpu *gpus;
......
...@@ -752,7 +752,7 @@ done: ...@@ -752,7 +752,7 @@ done:
/* Get a list of GPUs reported by XRandR 1.4. Set get_properties to FALSE if GPU properties are /* 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 */ * 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}; static const WCHAR wine_adapterW[] = {'W','i','n','e',' ','A','d','a','p','t','e','r',0};
struct gdi_gpu *gpus = NULL; struct gdi_gpu *gpus = NULL;
...@@ -849,11 +849,6 @@ done: ...@@ -849,11 +849,6 @@ done:
return ret; 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 ) static void xrandr14_free_gpus( struct gdi_gpu *gpus )
{ {
free( gpus ); free( gpus );
...@@ -1233,7 +1228,7 @@ static BOOL xrandr14_get_id( const WCHAR *device_name, BOOL is_primary, x11drv_s ...@@ -1233,7 +1228,7 @@ static BOOL xrandr14_get_id( const WCHAR *device_name, BOOL is_primary, x11drv_s
pthread_mutex_lock( &xrandr_mutex ); pthread_mutex_lock( &xrandr_mutex );
if (!current_modes) if (!current_modes)
{ {
if (!xrandr14_get_gpus2( &gpus, &gpu_count, FALSE )) if (!xrandr14_get_gpus( &gpus, &gpu_count, FALSE ))
{ {
pthread_mutex_unlock( &xrandr_mutex ); pthread_mutex_unlock( &xrandr_mutex );
return FALSE; return FALSE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment