Signed-off-by: Dmitry Timoshkov dmitry@baikal.ru --- dlls/winex11.drv/display.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index c8c216c8302..2da9b09c653 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -463,6 +463,12 @@ static BOOL link_device(const WCHAR *instance, const GUID *guid) static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT gpu_index, WCHAR *guid_string, WCHAR *driver, LUID *gpu_luid) { + static const WCHAR adapter_stringW[] = {'H','a','r','d','w','a','r','e','I','n','f','o','r','m','a','t','i','o','n','.','A','d','a','p','t','e','r','S','t','r','i','n','g',0}; + static const WCHAR bios_stringW[] = {'H','a','r','d','w','a','r','e','I','n','f','o','r','m','a','t','i','o','n','.','B','i','o','s','S','t','r','i','n','g',0}; + static const WCHAR chip_typeW[] = {'H','a','r','d','w','a','r','e','I','n','f','o','r','m','a','t','i','o','n','.','C','h','i','p','T','y','p','e',0}; + static const WCHAR dac_typeW[] = {'H','a','r','d','w','a','r','e','I','n','f','o','r','m','a','t','i','o','n','.','D','a','c','T','y','p','e',0}; + static const WCHAR ramdacW[] = {'I','n','t','e','r','g','r','a','t','e','d',' ','R','A','M','D','A','C',0}; + static const WCHAR memory_sizeW[] = {'H','a','r','d','w','a','r','e','I','n','f','o','r','m','a','t','i','o','n','.','M','e','m','o','r','y','S','i','z','e',0}; static const BOOL present = TRUE; SP_DEVINFO_DATA device_data = {sizeof(device_data)}; WCHAR instanceW[MAX_PATH]; @@ -551,6 +557,16 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g sprintfW(bufferW, driver_date_fmtW, systemtime.wMonth, systemtime.wDay, systemtime.wYear); if (RegSetValueExW(hkey, driver_dateW, 0, REG_SZ, (BYTE *)bufferW, (strlenW(bufferW) + 1) * sizeof(WCHAR))) goto done; + if (RegSetValueExW(hkey, adapter_stringW, 0, REG_SZ, (const BYTE *)gpu->name, (strlenW(gpu->name) + 1) * sizeof(WCHAR))) + goto done; + if (RegSetValueExW(hkey, bios_stringW, 0, REG_SZ, (const BYTE *)gpu->name, (strlenW(gpu->name) + 1) * sizeof(WCHAR))) + goto done; + if (RegSetValueExW(hkey, chip_typeW, 0, REG_SZ, (const BYTE *)gpu->name, (strlenW(gpu->name) + 1) * sizeof(WCHAR))) + goto done; + if (RegSetValueExW(hkey, dac_typeW, 0, REG_SZ, (const BYTE *)ramdacW, (strlenW(ramdacW) + 1) * sizeof(WCHAR))) + size = 0x7fffffff; /* FIXME */ + if (RegSetValueExW(hkey, memory_sizeW, 0, REG_DWORD, (const BYTE *)&size, sizeof(size))) + goto done;
RegCloseKey(hkey);
On 10/13/21 13:57, Dmitry Timoshkov wrote:
- if (RegSetValueExW(hkey, dac_typeW, 0, REG_SZ, (const BYTE *)ramdacW, (strlenW(ramdacW) + 1) * sizeof(WCHAR)))
- size = 0x7fffffff; /* FIXME */
We used to have all sort of issues in various games querying VRAM size through any sources the game is aware about and misbehaving due to assuming wrong VRAM size. Is it possible to get the real VRAM size at once? HardwareInformation.MemorySize seems to be capped at 0xfff00000 here with 8GB card on Windows. But there is also .qwMemorySize which is QWORD and holds real VRAM size. I thing once filling the legacy one we'd better also fill the full value as well. I suppose we can add VRAM size to x11drv_gpu and fill that in when querying GPU info through Vulkan. That might be still not entirely trivial as there are multiple heaps reported by Vulkan. I guess we should enumerate heaps with MEMORY_HEAP_DEVICE_LOCAL_BIT flag and choose the largest size.
Paul Gofman pgofman@codeweavers.com wrote:
On 10/13/21 13:57, Dmitry Timoshkov wrote:
- if (RegSetValueExW(hkey, dac_typeW, 0, REG_SZ, (const BYTE *)ramdacW, (strlenW(ramdacW) + 1) * sizeof(WCHAR)))
- size = 0x7fffffff; /* FIXME */
We used to have all sort of issues in various games querying VRAM size through any sources the game is aware about and misbehaving due to assuming wrong VRAM size. Is it possible to get the real VRAM size at once? HardwareInformation.MemorySize seems to be capped at 0xfff00000 here with 8GB card on Windows. But there is also .qwMemorySize which is QWORD and holds real VRAM size. I thing once filling the legacy one we'd better also fill the full value as well. I suppose we can add VRAM size to x11drv_gpu and fill that in when querying GPU info through Vulkan. That might be still not entirely trivial as there are multiple heaps reported by Vulkan. I guess we should enumerate heaps with MEMORY_HEAP_DEVICE_LOCAL_BIT flag and choose the largest size.
I haven't found a way to specify real card memory size from winex11.drv. Is there one that I've missed?
On 10/13/21 14:32, Dmitry Timoshkov wrote:
Paul Gofman pgofman@codeweavers.com wrote:
On 10/13/21 13:57, Dmitry Timoshkov wrote:
- if (RegSetValueExW(hkey, dac_typeW, 0, REG_SZ, (const BYTE *)ramdacW, (strlenW(ramdacW) + 1) * sizeof(WCHAR)))
- size = 0x7fffffff; /* FIXME */
We used to have all sort of issues in various games querying VRAM size through any sources the game is aware about and misbehaving due to assuming wrong VRAM size. Is it possible to get the real VRAM size at once? HardwareInformation.MemorySize seems to be capped at 0xfff00000 here with 8GB card on Windows. But there is also .qwMemorySize which is QWORD and holds real VRAM size. I thing once filling the legacy one we'd better also fill the full value as well. I suppose we can add VRAM size to x11drv_gpu and fill that in when querying GPU info through Vulkan. That might be still not entirely trivial as there are multiple heaps reported by Vulkan. I guess we should enumerate heaps with MEMORY_HEAP_DEVICE_LOCAL_BIT flag and choose the largest size.
I haven't found a way to specify real card memory size from winex11.drv. Is there one that I've missed?
I don't think we currently query VRAM suze anywhere in winex11.drv, no. What I am suggesting is to add the vram_size field to struct x11drv_gpu and fill that in xrandr.c:get_gpu_properties_from_vulkan() (even if leaving the same fallback default value for a case when Vulkan is not available; we currently rely on Vulkan for device info fill in winex11.drv anyway). If you are not up for dealing with that, maybe we can skip adding the memory size field for now and if the rest gets in I wll try to deal with that after?
Paul Gofman pgofman@codeweavers.com wrote:
On 10/13/21 14:32, Dmitry Timoshkov wrote:
Paul Gofman pgofman@codeweavers.com wrote:
On 10/13/21 13:57, Dmitry Timoshkov wrote:
- if (RegSetValueExW(hkey, dac_typeW, 0, REG_SZ, (const BYTE *)ramdacW, (strlenW(ramdacW) + 1) * sizeof(WCHAR)))
- size = 0x7fffffff; /* FIXME */
We used to have all sort of issues in various games querying VRAM size through any sources the game is aware about and misbehaving due to assuming wrong VRAM size. Is it possible to get the real VRAM size at once? HardwareInformation.MemorySize seems to be capped at 0xfff00000 here with 8GB card on Windows. But there is also .qwMemorySize which is QWORD and holds real VRAM size. I thing once filling the legacy one we'd better also fill the full value as well. I suppose we can add VRAM size to x11drv_gpu and fill that in when querying GPU info through Vulkan. That might be still not entirely trivial as there are multiple heaps reported by Vulkan. I guess we should enumerate heaps with MEMORY_HEAP_DEVICE_LOCAL_BIT flag and choose the largest size.
I haven't found a way to specify real card memory size from winex11.drv. Is there one that I've missed?
I don't think we currently query VRAM suze anywhere in winex11.drv, no. What I am suggesting is to add the vram_size field to struct x11drv_gpu and fill that in xrandr.c:get_gpu_properties_from_vulkan() (even if leaving the same fallback default value for a case when Vulkan is not available; we currently rely on Vulkan for device info fill in winex11.drv anyway). If you are not up for dealing with that, maybe we can skip adding the memory size field for now and if the rest gets in I wll try to deal with that after?
Sure, that's fine. I'll resend the patch without memory size part.