Currently, when GPUs are being added and display driver only provides a fake one (like e.g. winex11.drv does on Xwayland), its default name and empty UUID and PCI IDs will be preferred over ones reported by Vulkan. When Vulkan-only GPUs are added later, the resulting list will look like so:
``` Xrandr GPU 0x0000:0x0000 {00000000-0000-0000-0000-000000000000} NVIDIA GeForce RTX 4080 Laptop GPU 0x10de:0x27e0 {13938ad6-4925-b628-c068-30558bc4b489} ```
Instead, when default or empty properties were provided, we should prefer ones from Vulkan as they are more likely to be accurate:
``` Intel(R) Graphics (RPL-S) 0x8086:0xa788 {a7888086-0004-0000-0002-000000000000} NVIDIA GeForce RTX 4080 Laptop GPU 0x10de:0x27e0 {13938ad6-4925-b628-c068-30558bc4b489} ```
This is important for LUIDs to be later correctly assigned by winevulkan which searches for matching GPU by UUID.
I'm not exactly sure if this implementation is the way to go (especially reporting and checking name for `"Wine GPU"`) but it's probably one of the simplest possible. Let me know if we already have some empty UUID around I could use for the comparison.
-- v3: win32u: Prefer Vulkan UUIDs over empty ones. win32u: Prefer Vulkan PCI IDs over empty ones. win32u: Use common name for fake GPUs and prefer Vulkan name over it.
From: Krzysztof Bogacki krzysztof.bogacki@leancode.pl
Signed-off-by: Krzysztof Bogacki krzysztof.bogacki@leancode.pl --- dlls/win32u/sysparams.c | 4 ++-- dlls/wineandroid.drv/init.c | 2 +- dlls/winewayland.drv/display.c | 2 +- dlls/winex11.drv/xinerama.c | 2 +- dlls/winex11.drv/xrandr.c | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index c556f79719d..bd1100cbb98 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1252,7 +1252,7 @@ static void add_gpu( const char *name, const struct pci_id *pci_id, const GUID * if (vulkan_uuid) ctx->gpu.vulkan_uuid = *vulkan_uuid; else if (vulkan_gpu) ctx->gpu.vulkan_uuid = vulkan_gpu->uuid;
- if (!name && vulkan_gpu) name = vulkan_gpu->name; + if ((!name || !strcmp( name, "Wine GPU" )) && vulkan_gpu) name = vulkan_gpu->name; if (name) RtlUTF8ToUnicodeN( ctx->gpu.name, sizeof(ctx->gpu.name) - sizeof(WCHAR), &len, name, strlen( name ) );
snprintf( ctx->gpu.path, sizeof(ctx->gpu.path), "PCI\VEN_%04X&DEV_%04X&SUBSYS_%08X&REV_%02X\%08X", @@ -1799,7 +1799,7 @@ static NTSTATUS default_update_display_devices( struct device_manager_ctx *ctx ) struct gdi_monitor monitor = {0}; DEVMODEW mode = {.dmSize = sizeof(mode)};
- add_gpu( "Default GPU", &pci_id, NULL, ctx ); + add_gpu( "Wine GPU", &pci_id, NULL, ctx ); add_source( "Default", source_flags, ctx );
if (!read_source_mode( ctx->source_key, ENUM_CURRENT_SETTINGS, &mode )) diff --git a/dlls/wineandroid.drv/init.c b/dlls/wineandroid.drv/init.c index dd102375e44..d48c4153b06 100644 --- a/dlls/wineandroid.drv/init.c +++ b/dlls/wineandroid.drv/init.c @@ -281,7 +281,7 @@ UINT ANDROID_UpdateDisplayDevices( const struct gdi_device_manager *device_manag }; DEVMODEW current = mode;
- device_manager->add_gpu( "Android GPU", &pci_id, NULL, param ); + device_manager->add_gpu( "Wine GPU", &pci_id, NULL, param ); device_manager->add_source( "Default", source_flags, param ); device_manager->add_monitor( &gdi_monitor, param );
diff --git a/dlls/winewayland.drv/display.c b/dlls/winewayland.drv/display.c index 002bcd0f542..9b4ebe7cdc1 100644 --- a/dlls/winewayland.drv/display.c +++ b/dlls/winewayland.drv/display.c @@ -193,7 +193,7 @@ static void wayland_add_device_gpu(const struct gdi_device_manager *device_manag
TRACE("\n");
- device_manager->add_gpu("Wayland GPU", &pci_id, NULL, param); + device_manager->add_gpu("Wine GPU", &pci_id, NULL, param); }
static void wayland_add_device_source(const struct gdi_device_manager *device_manager, diff --git a/dlls/winex11.drv/xinerama.c b/dlls/winex11.drv/xinerama.c index c394c8a49b4..1fd170b0e07 100644 --- a/dlls/winex11.drv/xinerama.c +++ b/dlls/winex11.drv/xinerama.c @@ -199,7 +199,7 @@ static BOOL xinerama_get_gpus( struct x11drv_gpu **new_gpus, int *count, BOOL ge if (!gpus) return FALSE;
- gpus[0].name = strdup( "Xinerama GPU" ); + gpus[0].name = strdup( "Wine GPU" ); *new_gpus = gpus; *count = 1;
diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index d255864fe57..9a4284f493f 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -787,7 +787,7 @@ static BOOL xrandr14_get_gpus( struct x11drv_gpu **new_gpus, int *count, BOOL ge if (!provider_resources->nproviders) { WARN("XRandR implementation doesn't report any providers, faking one.\n"); - gpus[0].name = strdup( "Xrandr GPU" ); + gpus[0].name = strdup( "Wine GPU" ); *new_gpus = gpus; *count = 1; ret = TRUE;
From: Krzysztof Bogacki krzysztof.bogacki@leancode.pl
Signed-off-by: Krzysztof Bogacki krzysztof.bogacki@leancode.pl --- dlls/win32u/sysparams.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index bd1100cbb98..890ca8129de 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1252,6 +1252,8 @@ static void add_gpu( const char *name, const struct pci_id *pci_id, const GUID * if (vulkan_uuid) ctx->gpu.vulkan_uuid = *vulkan_uuid; else if (vulkan_gpu) ctx->gpu.vulkan_uuid = vulkan_gpu->uuid;
+ if (!pci_id->vendor && !pci_id->device && vulkan_gpu) pci_id = &vulkan_gpu->pci_id; + if ((!name || !strcmp( name, "Wine GPU" )) && vulkan_gpu) name = vulkan_gpu->name; if (name) RtlUTF8ToUnicodeN( ctx->gpu.name, sizeof(ctx->gpu.name) - sizeof(WCHAR), &len, name, strlen( name ) );
From: Krzysztof Bogacki krzysztof.bogacki@leancode.pl
Signed-off-by: Krzysztof Bogacki krzysztof.bogacki@leancode.pl --- dlls/win32u/sysparams.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 890ca8129de..49bf26214e7 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -1218,6 +1218,8 @@ static void add_gpu( const char *name, const struct pci_id *pci_id, const GUID * HKEY hkey, subkey; DWORD len;
+ static const GUID empty_uuid; + TRACE( "%s %04X %04X %08X %02X %s\n", debugstr_a( name ), pci_id->vendor, pci_id->device, pci_id->subsystem, pci_id->revision, debugstr_guid( vulkan_uuid ) );
@@ -1249,7 +1251,7 @@ static void add_gpu( const char *name, const struct pci_id *pci_id, const GUID * debugstr_guid(&vulkan_gpu->uuid), debugstr_a(vulkan_gpu->name)); }
- if (vulkan_uuid) ctx->gpu.vulkan_uuid = *vulkan_uuid; + if (vulkan_uuid && !IsEqualGUID( vulkan_uuid, &empty_uuid )) ctx->gpu.vulkan_uuid = *vulkan_uuid; else if (vulkan_gpu) ctx->gpu.vulkan_uuid = vulkan_gpu->uuid;
if (!pci_id->vendor && !pci_id->device && vulkan_gpu) pci_id = &vulkan_gpu->pci_id;
Hi,
It looks like your patch introduced the new failures shown below. Please investigate and fix them before resubmitting your patch. If they are not new, fixing them anyway would help a lot. Otherwise please ask for the known failures list to be updated.
The tests also ran into some preexisting test failures. If you know how to fix them that would be helpful. See the TestBot job for the details:
The full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=145884
Your paranoid android.
=== debian11 (build log) ===
error: patch failed: dlls/win32u/sysparams.c:1218 Task: Patch failed to apply