From: Brendan Shanks bshanks@codeweavers.com
--- dlls/win32u/sysparams.c | 37 ++++++++++++++++++++++++++++++++++--- include/wine/gdi_driver.h | 1 + 2 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/dlls/win32u/sysparams.c b/dlls/win32u/sysparams.c index 92ac330847d..6987c47847c 100644 --- a/dlls/win32u/sysparams.c +++ b/dlls/win32u/sysparams.c @@ -64,6 +64,7 @@ static const char devpropkey_device_ispresentA[] = "Properties\{540B947E-8B40-4 static const char devpropkey_monitor_gpu_luidA[] = "Properties\{CA085853-16CE-48AA-B114-DE9C72334223}\0001"; static const char devpropkey_monitor_output_idA[] = "Properties\{CA085853-16CE-48AA-B114-DE9C72334223}\0002"; static const char wine_devpropkey_monitor_rcworkA[] = "Properties\{233a9ef3-afc4-4abd-b564-c32f21f1535b}\0004"; +static const char wine_devpropkey_monitor_hdr_enabledA[] = "Properties\{233a9ef3-afc4-4abd-b564-c32f21f1535b}\0006";
static const WCHAR linkedW[] = {'L','i','n','k','e','d',0}; static const WCHAR symbolic_link_valueW[] = @@ -155,6 +156,7 @@ struct monitor RECT rc_work; BOOL is_clone; struct edid_monitor_info edid_info; + BOOL hdr_enabled; };
static struct list gpus = LIST_INIT(gpus); @@ -755,6 +757,16 @@ static BOOL read_monitor_from_registry( struct monitor *monitor ) NtClose( subkey ); }
+ /* WINE_DEVPROPKEY_MONITOR_HDR_ENABLED */ + size = query_reg_subkey_value( hkey, wine_devpropkey_monitor_hdr_enabledA, + value, sizeof(buffer) ); + if (size != sizeof(monitor->hdr_enabled)) + { + NtClose( hkey ); + return FALSE; + } + monitor->hdr_enabled = *(const BOOL *)value->Data; + NtClose( hkey ); return TRUE; } @@ -1928,6 +1940,14 @@ static BOOL write_monitor_to_registry( struct monitor *monitor, const BYTE *edid NtClose( subkey ); }
+ /* WINE_DEVPROPKEY_MONITOR_HDR_ENABLED */ + if ((subkey = reg_create_ascii_key( hkey, wine_devpropkey_monitor_hdr_enabledA, 0, NULL ))) + { + set_reg_value( subkey, NULL, 0xffff0000 | DEVPROP_TYPE_BOOLEAN, + &monitor->hdr_enabled, sizeof(monitor->hdr_enabled) ); + NtClose( subkey ); + } + NtClose( hkey );
@@ -1957,6 +1977,7 @@ static void add_monitor( const struct gdi_monitor *gdi_monitor, void *param ) monitor->id = source->monitor_count; monitor->output_id = ctx->monitor_count; monitor->rc_work = gdi_monitor->rc_work; + monitor->hdr_enabled = gdi_monitor->hdr_enabled;
TRACE( "%u %s %s\n", monitor->id, wine_dbgstr_rect(&gdi_monitor->rc_monitor), wine_dbgstr_rect(&gdi_monitor->rc_work) );
@@ -7786,12 +7807,22 @@ NTSTATUS WINAPI NtUserDisplayConfigGetDeviceInfo( DISPLAYCONFIG_DEVICE_INFO_HEAD sizeof(monitor->source->gpu->luid) )) continue;
- color_info->advancedColorSupported = 0; - color_info->advancedColorEnabled = 0; + if (monitor->hdr_enabled) + { + color_info->advancedColorSupported = 1; + color_info->advancedColorEnabled = 1; + color_info->bitsPerColorChannel = 10; + } + else + { + color_info->advancedColorSupported = 0; + color_info->advancedColorEnabled = 0; + color_info->bitsPerColorChannel = 8; + } color_info->wideColorEnforced = 0; color_info->advancedColorForceDisabled = 0; color_info->colorEncoding = DISPLAYCONFIG_COLOR_ENCODING_RGB; - color_info->bitsPerColorChannel = 8; + ret = STATUS_SUCCESS; break; } diff --git a/include/wine/gdi_driver.h b/include/wine/gdi_driver.h index 1e13900489e..81932436963 100644 --- a/include/wine/gdi_driver.h +++ b/include/wine/gdi_driver.h @@ -342,6 +342,7 @@ struct gdi_monitor RECT rc_work; /* RcWork in MONITORINFO struct */ unsigned char *edid; /* Extended Device Identification Data */ UINT edid_len; + BOOL hdr_enabled; };
struct gdi_device_manager