Skip to content

Commit

Permalink
Merge pull request xbmc#26096 from thexai/Windows_24H2-HDR-toggle
Browse files Browse the repository at this point in the history
[Windows] Add full support for HDR toggle in Windows 11 24H2
  • Loading branch information
thexai authored Dec 21, 2024
2 parents 02cede7 + 16a3753 commit 4935f3e
Show file tree
Hide file tree
Showing 10 changed files with 332 additions and 357 deletions.
1 change: 0 additions & 1 deletion xbmc/HDRStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

enum class HDR_STATUS
{
HDR_UNKNOWN = -2,
HDR_TOGGLE_FAILED = -1,
HDR_UNSUPPORTED = 0,
HDR_OFF = 1,
Expand Down
4 changes: 1 addition & 3 deletions xbmc/platform/win10/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ set(SOURCES CPUInfoWin10.cpp
../win32/MemUtils.cpp
../win32/pch.cpp
../win32/WIN32Util.cpp
../win32/WinRtUtil.cpp
../win32/XTimeUtils.cpp)

set(HEADERS AsyncHelpers.h
Expand All @@ -30,7 +29,6 @@ set(HEADERS AsyncHelpers.h
../win32/PlatformDefs.h
../win32/resource.h
../win32/unistd.h
../win32/WIN32Util.h
../win32/WinRtUtil.h)
../win32/WIN32Util.h)

core_add_library(platform_win10)
4 changes: 1 addition & 3 deletions xbmc/platform/win32/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ set(SOURCES CharsetConverter.cpp
PlatformWin32.cpp
WIN32Util.cpp
WindowHelper.cpp
WinRtUtil.cpp
XTimeUtils.cpp)

set(HEADERS CharsetConverter.h
Expand All @@ -28,7 +27,6 @@ set(HEADERS CharsetConverter.h
resource.h
unistd.h
WIN32Util.h
WindowHelper.h
WinRtUtil.h)
WindowHelper.h)

core_add_library(platform_win32)
62 changes: 62 additions & 0 deletions xbmc/platform/win32/SDK_26100.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
* Copyright (C) 2024 Team Kodi
* This file is part of Kodi - https://kodi.tv
*
* SPDX-License-Identifier: GPL-2.0-or-later
* See LICENSES/README.md for more information.
*/

#pragma once

enum
{
DISPLAYCONFIG_DEVICE_INFO_SET_RESERVED1 = 14,
DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO_2 = 15,
DISPLAYCONFIG_DEVICE_INFO_SET_HDR_STATE = 16,
DISPLAYCONFIG_DEVICE_INFO_SET_WCG_STATE = 17,
};

typedef enum _DISPLAYCONFIG_ADVANCED_COLOR_MODE
{
DISPLAYCONFIG_ADVANCED_COLOR_MODE_SDR,
DISPLAYCONFIG_ADVANCED_COLOR_MODE_WCG,
DISPLAYCONFIG_ADVANCED_COLOR_MODE_HDR
} DISPLAYCONFIG_ADVANCED_COLOR_MODE;

typedef struct _DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO_2
{
DISPLAYCONFIG_DEVICE_INFO_HEADER header;
union
{
struct
{
UINT32 advancedColorSupported : 1;
UINT32 advancedColorActive : 1;
UINT32 reserved1 : 1;
UINT32 advancedColorLimitedByPolicy : 1;
UINT32 highDynamicRangeSupported : 1;
UINT32 highDynamicRangeUserEnabled : 1;
UINT32 wideColorSupported : 1;
UINT32 wideColorUserEnabled : 1;
UINT32 reserved : 24;
};
UINT32 value;
};
DISPLAYCONFIG_COLOR_ENCODING colorEncoding;
UINT32 bitsPerColorChannel;
DISPLAYCONFIG_ADVANCED_COLOR_MODE activeColorMode;
} DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO_2;

typedef struct _DISPLAYCONFIG_SET_HDR_STATE
{
DISPLAYCONFIG_DEVICE_INFO_HEADER header;
union
{
struct
{
UINT32 enableHdr : 1;
UINT32 reserved : 31;
};
UINT32 value;
};
} DISPLAYCONFIG_SET_HDR_STATE;
Loading

0 comments on commit 4935f3e

Please sign in to comment.