Module: wine Branch: master Commit: 76713da1e013e939c91077c6b36cc3ff31357f85 URL: https://gitlab.winehq.org/wine/wine/-/commit/76713da1e013e939c91077c6b36cc3f...
Author: Paul Gofman pgofman@codeweavers.com Date: Mon Feb 13 14:32:09 2023 -0600
win32u: Store EDID info in monitors cache.
---
dlls/win32u/sysparams.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 2805f71311f..1ee2ad9b740 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -170,6 +170,7 @@ static const WCHAR monitorW[] = {'M','o','n','i','t','o','r',0}; static const WCHAR yesW[] = {'Y','e','s',0}; static const WCHAR noW[] = {'N','o',0}; static const WCHAR mode_countW[] = {'M','o','d','e','C','o','u','n','t',0}; +static const WCHAR edidW[] = {'E','D','I','D',0};
static const char guid_devclass_displayA[] = "{4D36E968-E325-11CE-BFC1-08002BE10318}"; static const WCHAR guid_devclass_displayW[] = @@ -238,6 +239,7 @@ struct monitor RECT rc_monitor; RECT rc_work; BOOL is_clone; + struct edid_monitor_info edid_info; };
static struct list adapters = LIST_INIT(adapters); @@ -749,7 +751,7 @@ static BOOL read_monitor_settings( struct adapter *adapter, UINT index, struct m char buffer[4096]; KEY_VALUE_PARTIAL_INFORMATION *value = (void *)buffer; WCHAR *device_name, *value_str = (WCHAR *)value->Data, *ptr; - HKEY hkey; + HKEY hkey, subkey; DWORD size, len;
monitor->flags = adapter->id ? 0 : MONITORINFOF_PRIMARY; @@ -856,6 +858,14 @@ static BOOL read_monitor_settings( struct adapter *adapter, UINT index, struct m monitor->dev.device_id[size++] = '\'; lstrcpyW( monitor->dev.device_id + size, device_name );
+ /* EDID */ + if ((subkey = reg_open_key( hkey, device_parametersW, sizeof(device_parametersW) ))) + { + if (query_reg_value( subkey, edidW, value, sizeof(buffer) )) + get_monitor_info_from_edid( &monitor->edid_info, value->Data, value->DataLength ); + NtClose( subkey ); + } + NtClose( hkey ); return TRUE; } @@ -1380,7 +1390,6 @@ static void add_monitor( const struct gdi_monitor *monitor, void *param ) if ((subkey = reg_create_key( hkey, device_parametersW, sizeof(device_parametersW), 0, NULL ))) { static const WCHAR bad_edidW[] = {'B','A','D','_','E','D','I','D',0}; - static const WCHAR edidW[] = {'E','D','I','D',0};
if (monitor->edid_len) set_reg_value( subkey, edidW, REG_BINARY, monitor->edid, monitor->edid_len );