Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/winex11.drv/display.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 3e9e4474d4c6..9b6edba6eae4 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -51,6 +51,7 @@ DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_RCWORK, 0x233a9ef3, 0xafc4, 0x4abd, 0x DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_ADAPTERNAME, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 5);
static const WCHAR driver_date_dataW[] = {'D','r','i','v','e','r','D','a','t','e','D','a','t','a',0}; +static const WCHAR driver_dateW[] = {'D','r','i','v','e','r','D','a','t','e',0}; static const WCHAR driver_descW[] = {'D','r','i','v','e','r','D','e','s','c',0}; static const WCHAR displayW[] = {'D','I','S','P','L','A','Y',0}; static const WCHAR pciW[] = {'P','C','I',0}; @@ -107,6 +108,7 @@ static const WCHAR monitor_instance_fmtW[] = { static const WCHAR monitor_hardware_idW[] = { 'M','O','N','I','T','O','R','\', 'D','e','f','a','u','l','t','_','M','o','n','i','t','o','r',0,0}; +static const WCHAR driver_date_fmtW[] = {'%','u','.','%','u',0};
static struct x11drv_display_device_handler host_handler; struct x11drv_display_device_handler desktop_handler; @@ -403,14 +405,15 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g SP_DEVINFO_DATA device_data = {sizeof(device_data)}; WCHAR instanceW[MAX_PATH]; DEVPROPTYPE property_type; + SYSTEMTIME systemtime; WCHAR bufferW[1024]; + FILETIME filetime; HKEY hkey = NULL; GUID guid; LUID luid; INT written; DWORD size; BOOL ret = FALSE; - FILETIME filetime;
TRACE("GPU id:0x%s name:%s.\n", wine_dbgstr_longlong(gpu->id), wine_dbgstr_w(gpu->name));
@@ -468,6 +471,11 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g if (RegSetValueExW(hkey, driver_date_dataW, 0, REG_BINARY, (BYTE *)&filetime, sizeof(filetime))) goto done;
+ GetSystemTime(&systemtime); + sprintfW(bufferW, driver_date_fmtW, systemtime.wYear, systemtime.wMonth); + if (RegSetValueExW(hkey, driver_dateW, 0, REG_SZ, (BYTE *)bufferW, (strlenW(bufferW) + 1) * sizeof(WCHAR))) + goto done; + RegCloseKey(hkey);
/* Retrieve driver value for adapters */
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/winex11.drv/display.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 9b6edba6eae4..31d2fa2bccd4 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -58,7 +58,7 @@ static const WCHAR pciW[] = {'P','C','I',0}; static const WCHAR video_idW[] = {'V','i','d','e','o','I','D',0}; static const WCHAR symbolic_link_valueW[]= {'S','y','m','b','o','l','i','c','L','i','n','k','V','a','l','u','e',0}; static const WCHAR gpu_idW[] = {'G','P','U','I','D',0}; -static const WCHAR mointor_id_fmtW[] = {'M','o','n','i','t','o','r','I','D','%','d',0}; +static const WCHAR monitor_id_fmtW[] = {'M','o','n','i','t','o','r','I','D','%','d',0}; static const WCHAR adapter_name_fmtW[] = {'\','\','.','\','D','I','S','P','L','A','Y','%','d',0}; static const WCHAR state_flagsW[] = {'S','t','a','t','e','F','l','a','g','s',0}; static const WCHAR guid_fmtW[] = { @@ -555,7 +555,7 @@ static BOOL X11DRV_InitAdapter(HKEY video_hkey, INT video_index, INT gpu_index, /* Write all monitor instances paths under this adapter */ for (i = 0; i < monitor_count; i++) { - sprintfW(key_nameW, mointor_id_fmtW, i); + sprintfW(key_nameW, monitor_id_fmtW, i); sprintfW(bufferW, monitor_instance_fmtW, video_index, i); if (RegSetValueExW(hkey, key_nameW, 0, REG_SZ, (const BYTE *)bufferW, (strlenW(bufferW) + 1) * sizeof(WCHAR))) goto done;
Signed-off-by: Zhiyi Zhang zzhang@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- I picked the more or less current version of the AMD driver for the time being.
I think we should eventually move wined3d's GPU driver detection and override stuff to the display drivers (TBD how to share code between the different drivers) so that everything has the same consistent view.
dlls/winex11.drv/display.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 31d2fa2bccd4..742f0ba9fd6a 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -53,6 +53,7 @@ DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_ADAPTERNAME, 0x233a9ef3, 0xafc4, 0x4ab static const WCHAR driver_date_dataW[] = {'D','r','i','v','e','r','D','a','t','e','D','a','t','a',0}; static const WCHAR driver_dateW[] = {'D','r','i','v','e','r','D','a','t','e',0}; static const WCHAR driver_descW[] = {'D','r','i','v','e','r','D','e','s','c',0}; +static const WCHAR driver_versionW[] = {'D','r','i','v','e','r','V','e','r','s','i','o','n',0}; static const WCHAR displayW[] = {'D','I','S','P','L','A','Y',0}; static const WCHAR pciW[] = {'P','C','I',0}; static const WCHAR video_idW[] = {'V','i','d','e','o','I','D',0}; @@ -109,6 +110,7 @@ static const WCHAR monitor_hardware_idW[] = { 'M','O','N','I','T','O','R','\', 'D','e','f','a','u','l','t','_','M','o','n','i','t','o','r',0,0}; static const WCHAR driver_date_fmtW[] = {'%','u','.','%','u',0}; +static const WCHAR driver_version_fallbackW[] ={'2','6','.','2','0','.','1','5','0','0','2','.','6','1',0};
static struct x11drv_display_device_handler host_handler; struct x11drv_display_device_handler desktop_handler; @@ -476,6 +478,10 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g if (RegSetValueExW(hkey, driver_dateW, 0, REG_SZ, (BYTE *)bufferW, (strlenW(bufferW) + 1) * sizeof(WCHAR))) goto done;
+ if (RegSetValueExW(hkey, driver_versionW, 0, REG_SZ, (const BYTE *)driver_version_fallbackW, + sizeof(driver_version_fallbackW))) + goto done; + RegCloseKey(hkey);
/* Retrieve driver value for adapters */
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/winex11.drv/display.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 742f0ba9fd6a..8a479d825ba1 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -54,6 +54,7 @@ static const WCHAR driver_date_dataW[] = {'D','r','i','v','e','r','D','a','t','e static const WCHAR driver_dateW[] = {'D','r','i','v','e','r','D','a','t','e',0}; static const WCHAR driver_descW[] = {'D','r','i','v','e','r','D','e','s','c',0}; static const WCHAR driver_versionW[] = {'D','r','i','v','e','r','V','e','r','s','i','o','n',0}; +static const WCHAR provider_nameW[] = {'P','r','o','v','i','d','e','r','N','a','m','e',0}; static const WCHAR displayW[] = {'D','I','S','P','L','A','Y',0}; static const WCHAR pciW[] = {'P','C','I',0}; static const WCHAR video_idW[] = {'V','i','d','e','o','I','D',0}; @@ -111,6 +112,7 @@ static const WCHAR monitor_hardware_idW[] = { 'D','e','f','a','u','l','t','_','M','o','n','i','t','o','r',0,0}; static const WCHAR driver_date_fmtW[] = {'%','u','.','%','u',0}; static const WCHAR driver_version_fallbackW[] ={'2','6','.','2','0','.','1','5','0','0','2','.','6','1',0}; +static const WCHAR provider_name_fallbackW[] ={'A','d','v','a','n','c','e','d',' ','M','i','c','r','o',' ','D','e','v','i','c','e','s',',',' ','I','n','c','.',0};
static struct x11drv_display_device_handler host_handler; struct x11drv_display_device_handler desktop_handler; @@ -482,6 +484,10 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g sizeof(driver_version_fallbackW))) goto done;
+ if (RegSetValueExW(hkey, provider_nameW, 0, REG_SZ, (const BYTE *)provider_name_fallbackW, + sizeof(provider_name_fallbackW))) + goto done; + RegCloseKey(hkey);
/* Retrieve driver value for adapters */
Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- dlls/winex11.drv/display.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 8a479d825ba1..166946c158f0 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -746,6 +746,12 @@ void X11DRV_DisplayDevices_Init(BOOL force)
for (gpu = 0; gpu < gpu_count; gpu++) { + /* Default to an AMD Radeon RX 5700 */ + if (!gpus[gpu].vendor_id) + gpus[gpu].vendor_id = 0x1002; + if (!gpus[gpu].device_id) + gpus[gpu].device_id = 0x731f; + if (!X11DRV_InitGpu(gpu_devinfo, &gpus[gpu], gpu, guidW, driverW, &gpu_luid)) goto done;
On 9/30/20 6:55 PM, Matteo Bruni wrote:
Signed-off-by: Matteo Bruni mbruni@codeweavers.com
dlls/winex11.drv/display.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c index 3e9e4474d4c6..9b6edba6eae4 100644 --- a/dlls/winex11.drv/display.c +++ b/dlls/winex11.drv/display.c @@ -51,6 +51,7 @@ DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_RCWORK, 0x233a9ef3, 0xafc4, 0x4abd, 0x DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_ADAPTERNAME, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 5);
static const WCHAR driver_date_dataW[] = {'D','r','i','v','e','r','D','a','t','e','D','a','t','a',0}; +static const WCHAR driver_dateW[] = {'D','r','i','v','e','r','D','a','t','e',0}; static const WCHAR driver_descW[] = {'D','r','i','v','e','r','D','e','s','c',0}; static const WCHAR displayW[] = {'D','I','S','P','L','A','Y',0}; static const WCHAR pciW[] = {'P','C','I',0}; @@ -107,6 +108,7 @@ static const WCHAR monitor_instance_fmtW[] = { static const WCHAR monitor_hardware_idW[] = { 'M','O','N','I','T','O','R','\', 'D','e','f','a','u','l','t','_','M','o','n','i','t','o','r',0,0}; +static const WCHAR driver_date_fmtW[] = {'%','u','.','%','u',0};
I think this is depended on locale. For example, It is something like 9-4-2020 in my Win7 and Win10 VMs.
static struct x11drv_display_device_handler host_handler; struct x11drv_display_device_handler desktop_handler; @@ -403,14 +405,15 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g SP_DEVINFO_DATA device_data = {sizeof(device_data)}; WCHAR instanceW[MAX_PATH]; DEVPROPTYPE property_type;
- SYSTEMTIME systemtime; WCHAR bufferW[1024];
- FILETIME filetime; HKEY hkey = NULL; GUID guid; LUID luid; INT written; DWORD size; BOOL ret = FALSE;
FILETIME filetime;
TRACE("GPU id:0x%s name:%s.\n", wine_dbgstr_longlong(gpu->id), wine_dbgstr_w(gpu->name));
@@ -468,6 +471,11 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g if (RegSetValueExW(hkey, driver_date_dataW, 0, REG_BINARY, (BYTE *)&filetime, sizeof(filetime))) goto done;
GetSystemTime(&systemtime);
sprintfW(bufferW, driver_date_fmtW, systemtime.wYear, systemtime.wMonth);
if (RegSetValueExW(hkey, driver_dateW, 0, REG_SZ, (BYTE *)bufferW, (strlenW(bufferW) + 1) * sizeof(WCHAR)))
goto done;
RegCloseKey(hkey);
/* Retrieve driver value for adapters */