Module: wine Branch: master Commit: 0300016ac54502200b37dd9bd8e4a97cfa41cc10 URL: https://gitlab.winehq.org/wine/wine/-/commit/0300016ac54502200b37dd9bd8e4a97...
Author: Rémi Bernon rbernon@codeweavers.com Date: Mon Apr 22 18:16:07 2024 +0200
win32u: Remove driver-specific id from struct gdi_gpu.
---
dlls/winemac.drv/display.c | 1 - dlls/winewayland.drv/display.c | 3 +-- dlls/winex11.drv/display.c | 13 ++++++++++--- dlls/winex11.drv/x11drv.h | 13 +++++++++++-- dlls/winex11.drv/xinerama.c | 6 +++--- dlls/winex11.drv/xrandr.c | 14 +++++++------- include/wine/gdi_driver.h | 1 - 7 files changed, 32 insertions(+), 19 deletions(-)
diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index b52bb39c0f6..fc2e680ca88 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -1141,7 +1141,6 @@ BOOL macdrv_UpdateDisplayDevices( const struct gdi_device_manager *device_manage { struct gdi_gpu gdi_gpu = { - .id = gpu->id, .pci_id = { .vendor = gpu->vendor_id, diff --git a/dlls/winewayland.drv/display.c b/dlls/winewayland.drv/display.c index 535a3c80ce3..efe5683d4eb 100644 --- a/dlls/winewayland.drv/display.c +++ b/dlls/winewayland.drv/display.c @@ -204,8 +204,7 @@ static void wayland_add_device_gpu(const struct gdi_device_manager *device_manag struct gdi_gpu gpu = {0}; lstrcpyW(gpu.name, wayland_gpuW);
- TRACE("id=0x%s name=%s\n", - wine_dbgstr_longlong(gpu.id), wine_dbgstr_w(gpu.name)); + TRACE("name=%s\n", wine_dbgstr_w(gpu.name));
device_manager->add_gpu(&gpu, param); } diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 3ec20743f66..d64f6bb92d6 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -395,7 +395,7 @@ POINT root_to_virtual_screen(INT x, INT y) RECT get_host_primary_monitor_rect(void) { INT gpu_count, adapter_count, monitor_count; - struct gdi_gpu *gpus = NULL; + struct x11drv_gpu *gpus = NULL; struct x11drv_adapter *adapters = NULL; struct gdi_monitor *monitors = NULL; RECT rect = {0}; @@ -497,7 +497,7 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage { struct x11drv_adapter *adapters; struct gdi_monitor *monitors; - struct gdi_gpu *gpus; + struct x11drv_gpu *gpus; INT gpu_count, adapter_count, monitor_count; INT gpu, adapter, monitor; DEVMODEW *modes; @@ -514,7 +514,14 @@ BOOL X11DRV_UpdateDisplayDevices( const struct gdi_device_manager *device_manage
for (gpu = 0; gpu < gpu_count; gpu++) { - device_manager->add_gpu( &gpus[gpu], param ); + struct gdi_gpu gdi_gpu = + { + .pci_id = gpus[gpu].pci_id, + .vulkan_uuid = gpus[gpu].vulkan_uuid, + .memory_size = gpus[gpu].memory_size, + }; + memcpy( gdi_gpu.name, gpus[gpu].name, sizeof(gdi_gpu.name) ); + device_manager->add_gpu( &gdi_gpu, param );
/* Initialize adapters */ if (!host_handler.get_adapters( gpus[gpu].id, &adapters, &adapter_count )) break; diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 384074becad..b4e63f1fbce 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -764,6 +764,15 @@ void init_user_driver(void);
/* X11 display device handler. Used to initialize display device registry data */
+struct x11drv_gpu +{ + ULONG_PTR id; + WCHAR name[128]; + struct pci_id pci_id; + GUID vulkan_uuid; + ULONGLONG memory_size; +}; + struct x11drv_adapter { ULONG_PTR id; @@ -782,7 +791,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_properties); + BOOL (*get_gpus)(struct x11drv_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. @@ -797,7 +806,7 @@ struct x11drv_display_device_handler BOOL (*get_monitors)(ULONG_PTR adapter_id, struct gdi_monitor **monitors, int *count);
/* free_gpus will be called to free a GPU list from get_gpus */ - void (*free_gpus)(struct gdi_gpu *gpus); + void (*free_gpus)(struct x11drv_gpu *gpus);
/* free_adapters will be called to free an adapter list from get_adapters */ void (*free_adapters)(struct x11drv_adapter *adapters); diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c index fbf80819204..5f489feb59d 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -190,10 +190,10 @@ done: return ret; }
-static BOOL xinerama_get_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_properties ) +static BOOL xinerama_get_gpus( struct x11drv_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; + struct x11drv_gpu *gpus;
/* Xinerama has no support for GPU, faking one */ gpus = calloc( 1, sizeof(*gpus) ); @@ -208,7 +208,7 @@ static BOOL xinerama_get_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_p return TRUE; }
-static void xinerama_free_gpus( struct gdi_gpu *gpus ) +static void xinerama_free_gpus( struct x11drv_gpu *gpus ) { free( gpus ); } diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index e183501b23f..51b316e71bd 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -627,8 +627,8 @@ static BOOL is_crtc_primary( RECT primary, const XRRCrtcInfo *crtc )
VK_DEFINE_NON_DISPATCHABLE_HANDLE(VkDisplayKHR)
-static BOOL get_gpu_properties_from_vulkan( struct gdi_gpu *gpu, const XRRProviderInfo *provider_info, - struct gdi_gpu *prev_gpus, int prev_gpu_count ) +static BOOL get_gpu_properties_from_vulkan( struct x11drv_gpu *gpu, const XRRProviderInfo *provider_info, + struct x11drv_gpu *prev_gpus, int prev_gpu_count ) { static const char *extensions[] = { @@ -768,10 +768,10 @@ 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_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_properties ) +static BOOL xrandr14_get_gpus( struct x11drv_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; + struct x11drv_gpu *gpus = NULL; XRRScreenResources *screen_resources = NULL; XRRProviderResources *provider_resources = NULL; XRRProviderInfo *provider_info = NULL; @@ -844,7 +844,7 @@ static BOOL xrandr14_get_gpus( struct gdi_gpu **new_gpus, int *count, BOOL get_p /* Make primary GPU the first */ if (primary_provider > 0) { - struct gdi_gpu tmp = gpus[0]; + struct x11drv_gpu tmp = gpus[0]; gpus[0] = gpus[primary_provider]; gpus[primary_provider] = tmp; } @@ -865,7 +865,7 @@ done: return ret; }
-static void xrandr14_free_gpus( struct gdi_gpu *gpus ) +static void xrandr14_free_gpus( struct x11drv_gpu *gpus ) { free( gpus ); } @@ -1253,7 +1253,7 @@ static BOOL xrandr14_get_id( const WCHAR *device_name, BOOL is_primary, x11drv_s INT gpu_count, adapter_count, new_current_mode_count = 0; INT gpu_idx, adapter_idx, display_idx; struct x11drv_adapter *adapters; - struct gdi_gpu *gpus; + struct x11drv_gpu *gpus; WCHAR *end;
/* Parse \.\DISPLAY%d */ diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 447b5a86988..714db83e89c 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -247,7 +247,6 @@ struct pci_id
struct gdi_gpu { - ULONG_PTR id; WCHAR name[128]; struct pci_id pci_id; GUID vulkan_uuid; /* Vulkan device UUID */