From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winex11.drv/desktop.c | 2 +- dlls/winex11.drv/display.c | 6 +++--- dlls/winex11.drv/x11drv.h | 2 +- dlls/winex11.drv/xinerama.c | 2 +- dlls/winex11.drv/xrandr.c | 9 ++------- 5 files changed, 8 insertions(+), 13 deletions(-)
diff --git a/dlls/winex11.drv/desktop.c b/dlls/winex11.drv/desktop.c index 05e00a2b333..7dc149b2e95 100644 --- a/dlls/winex11.drv/desktop.c +++ b/dlls/winex11.drv/desktop.c @@ -260,7 +260,7 @@ static void query_desktop_work_area( RECT *rc_work ) TRACE( "found tray %p %s work area %s\n", hwnd, wine_dbgstr_rect( &rect ), wine_dbgstr_rect( rc_work ) ); }
-static BOOL X11DRV_desktop_get_gpus( struct gdi_gpu **new_gpus, int *count ) +static BOOL X11DRV_desktop_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 *gpu; diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 3e20f9be22b..4465f3765b5 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -464,7 +464,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, TRUE) && 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; @@ -480,7 +480,7 @@ BOOL get_host_primary_gpu(struct gdi_gpu *gpu) struct gdi_gpu *gpus; INT gpu_count;
- if (host_handler.get_gpus(&gpus, &gpu_count) && gpu_count) + if (host_handler.get_gpus(&gpus, &gpu_count, TRUE) && gpu_count) { *gpu = gpus[0]; host_handler.free_gpus(gpus); @@ -586,7 +586,7 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage TRACE("via %s\n", wine_dbgstr_a(handler->name));
/* Initialize GPUs */ - if (!handler->get_gpus( &gpus, &gpu_count )) return FALSE; + if (!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 856436a9e02..b5f948fa232 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -772,7 +772,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 847b8fb6efb..94254f43098 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -122,7 +122,7 @@ static inline int query_screens(void)
#endif /* SONAME_LIBXINERAMA */
-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 f76043a701f..42cbe213333 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -760,7 +760,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; @@ -857,11 +857,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 ); @@ -1244,7 +1239,7 @@ static BOOL xrandr14_get_id( const WCHAR *device_name, ULONG_PTR *id, BOOL *is_p 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;