Signed-off-by: Brendan Shanks bshanks@codeweavers.com --- dlls/winemac.drv/display.c | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-)
diff --git a/dlls/winemac.drv/display.c b/dlls/winemac.drv/display.c index 7d9ff2d7c6..65c46f7dcc 100644 --- a/dlls/winemac.drv/display.c +++ b/dlls/winemac.drv/display.c @@ -52,6 +52,8 @@ struct display_mode_descriptor BOOL CDECL macdrv_EnumDisplaySettingsEx(LPCWSTR devname, DWORD mode, LPDEVMODEW devmode, DWORD flags);
DEFINE_DEVPROPKEY(DEVPROPKEY_GPU_LUID, 0x60b193cb, 0x5276, 0x4d0f, 0x96, 0xfc, 0xf1, 0x73, 0xab, 0xad, 0x3e, 0xc6, 2); +DEFINE_DEVPROPKEY(DEVPROPKEY_MONITOR_GPU_LUID, 0xca085853, 0x16ce, 0x48aa, 0xb1, 0x14, 0xde, 0x9c, 0x72, 0x33, 0x42, 0x23, 1); +DEFINE_DEVPROPKEY(DEVPROPKEY_MONITOR_OUTPUT_ID, 0xca085853, 0x16ce, 0x48aa, 0xb1, 0x14, 0xde, 0x9c, 0x72, 0x33, 0x42, 0x23, 2);
/* Wine specific monitor properties */ DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_STATEFLAGS, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 2); @@ -1366,7 +1368,7 @@ void macdrv_displays_changed(const macdrv_event *event) * Return FALSE on failure and TRUE on success. */ static BOOL macdrv_init_gpu(HDEVINFO devinfo, const struct macdrv_gpu *gpu, int gpu_index, WCHAR *guid_string, - WCHAR *driver) + WCHAR *driver, LUID *gpu_luid) { static const BOOL present = TRUE; SP_DEVINFO_DATA device_data = {sizeof(device_data)}; @@ -1414,6 +1416,7 @@ static BOOL macdrv_init_gpu(HDEVINFO devinfo, const struct macdrv_gpu *gpu, int DEVPROP_TYPE_UINT64, (const BYTE *)&luid, sizeof(luid), 0)) goto done; } + *gpu_luid = luid; TRACE("GPU id:0x%s name:%s LUID:%08x:%08x.\n", wine_dbgstr_longlong(gpu->id), gpu->name, luid.HighPart, luid.LowPart);
@@ -1541,7 +1544,7 @@ done: * Return FALSE on failure and TRUE on success. */ static BOOL macdrv_init_monitor(HDEVINFO devinfo, const struct macdrv_monitor *monitor, int monitor_index, - int video_index) + int video_index, const LUID *gpu_luid) { SP_DEVINFO_DATA device_data = {sizeof(SP_DEVINFO_DATA)}; WCHAR nameW[MAX_PATH]; @@ -1562,6 +1565,16 @@ static BOOL macdrv_init_monitor(HDEVINFO devinfo, const struct macdrv_monitor *m (const BYTE *)monitor_hardware_idW, sizeof(monitor_hardware_idW))) goto done;
+ /* Write DEVPROPKEY_MONITOR_GPU_LUID */ + if (!SetupDiSetDevicePropertyW(devinfo, &device_data, &DEVPROPKEY_MONITOR_GPU_LUID, + DEVPROP_TYPE_INT64, (const BYTE *)gpu_luid, sizeof(*gpu_luid), 0)) + goto done; + + /* Write DEVPROPKEY_MONITOR_OUTPUT_ID */ + if (!SetupDiSetDevicePropertyW(devinfo, &device_data, &DEVPROPKEY_MONITOR_OUTPUT_ID, + DEVPROP_TYPE_UINT32, (const BYTE *)&video_index, sizeof(video_index), 0)) + goto done; + /* Create driver key */ hkey = SetupDiCreateDevRegKeyW(devinfo, &device_data, DICS_FLAG_GLOBAL, 0, DIREG_DRV, NULL, NULL); RegCloseKey(hkey); @@ -1670,6 +1683,7 @@ void macdrv_init_display_devices(BOOL force) DWORD disposition = 0; WCHAR guidW[40]; WCHAR driverW[1024]; + LUID gpu_luid;
mutex = CreateMutexW(NULL, FALSE, init_mutexW); WaitForSingleObject(mutex, INFINITE); @@ -1699,7 +1713,7 @@ void macdrv_init_display_devices(BOOL force)
for (gpu = 0; gpu < gpu_count; gpu++) { - if (!macdrv_init_gpu(gpu_devinfo, &gpus[gpu], gpu, guidW, driverW)) + if (!macdrv_init_gpu(gpu_devinfo, &gpus[gpu], gpu, guidW, driverW, &gpu_luid)) goto done;
/* Initialize adapters */ @@ -1721,7 +1735,7 @@ void macdrv_init_display_devices(BOOL force) for (monitor = 0; monitor < monitor_count; monitor++) { TRACE("monitor: %#x %s\n", monitor, monitors[monitor].name); - if (!macdrv_init_monitor(monitor_devinfo, &monitors[monitor], monitor, video_index)) + if (!macdrv_init_monitor(monitor_devinfo, &monitors[monitor], monitor, video_index, &gpu_luid)) goto done; }