View Single Post
Old 29th January 2020, 18:42   #26  |  Link
pistacho
Registered User
 
Join Date: Feb 2010
Location: Spain
Posts: 549
Quote:
Originally Posted by Fandangos View Post
It's because the API that is called is not documented, it emerged from someone knows where.

According to the txt from the first release of that code, people found out about those APIs analyzing windows registry changes after triggering HDR on and OFF. That's quite a hack in my honest opinion.

That's just my guess how people did it based on that txt.

Kodi was part of a program that brought it to the Microsoft Windows Store.
It's also part of the Xbox game console store.
Both under the supervision of Microsoft.
Some of TK devs were part of the microsoft internal programs.

Since the API is not well documented and it's not publicly advertised to be used, I completly understand their stance to back away from it.

Putting it into an addon just protects Kodi.

Whilte on the other hand I completly understand your frustration and I honestly wish to put this HDR situation in the past.
Just having an automatic solution that works for everybody without restrictions.

This way we (or me) could ,ove along to something else like adding FSRCNNX upscaler to Kodi.

Just my opinion on this.

And I'm trying to fix Ryzen with private APIs here, which that code to turn HDR on and off solves the problem.
Since you are also working with that code, I would like to ask if you know why it defaults back to 60hz breaking 23hz.

It does for me no matter the moment it is triggered (except before playbackstarting).

If you have found a solution I really would like to know because this could be greatly used on my fork to help people with Ryzen igpus and RX 5700 gpus both plagued by this bug where bt.2020 flag using amd ags doesn't show up.

This is totally false.
  1. Code in my fork currently is not the same as original code you mention
  2. Even original code is not a hack. Is only bad documented, buggy code and poor styling code.

For some reason some people have formed a misconception of all this and now it is very difficult (perhaps impossible) to understand things correctly.


Step one download and install Windows SDK 10.0.17763 and look at "wingdi.h"


NOTE: // comments are NOT written by me. Written by Microsoft. (download and check yourself)

Code:
typedef struct _DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO
{
    DISPLAYCONFIG_DEVICE_INFO_HEADER header;
    union
    {
        struct
        {
          UINT32 advancedColorSupported        :1;    // A type of advanced color is supported
          UINT32 advancedColorEnabled          :1;    // A type of advanced color is enabled
          UINT32 wideColorEnforced             :1;    // Wide color gamut is enabled
          UINT32 advancedColorForceDisabled    :1;    // Advanced color is force disabled due to system/OS policy
          UINT32 reserved                      :28;
        } DUMMYSTRUCTNAME;

        UINT32 value;
    } DUMMYUNIONNAME;

    DISPLAYCONFIG_COLOR_ENCODING colorEncoding;
    UINT32 bitsPerColorChannel;
} DISPLAYCONFIG_GET_ADVANCED_COLOR_INFO;

typedef struct _DISPLAYCONFIG_SET_ADVANCED_COLOR_STATE
{
    DISPLAYCONFIG_DEVICE_INFO_HEADER header;
    union
    {
        struct
        {
          UINT32 enableAdvancedColor  :1;
          UINT32 reserved  :31;
        } DUMMYSTRUCTNAME;

        UINT32 value;
    }DUMMYUNIONNAME;
} DISPLAYCONFIG_SET_ADVANCED_COLOR_STATE;

typedef enum
{
      DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME                 = 1,
      DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME                 = 2,
      DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_PREFERRED_MODE       = 3,
      DISPLAYCONFIG_DEVICE_INFO_GET_ADAPTER_NAME                = 4,
      DISPLAYCONFIG_DEVICE_INFO_SET_TARGET_PERSISTENCE          = 5,
      DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_BASE_TYPE            = 6,
      DISPLAYCONFIG_DEVICE_INFO_GET_SUPPORT_VIRTUAL_RESOLUTION  = 7,
      DISPLAYCONFIG_DEVICE_INFO_SET_SUPPORT_VIRTUAL_RESOLUTION  = 8,
      DISPLAYCONFIG_DEVICE_INFO_GET_ADVANCED_COLOR_INFO         = 9,
      DISPLAYCONFIG_DEVICE_INFO_SET_ADVANCED_COLOR_STATE        = 10,
      DISPLAYCONFIG_DEVICE_INFO_GET_SDR_WHITE_LEVEL             = 11,
      DISPLAYCONFIG_DEVICE_INFO_FORCE_UINT32                = 0xFFFFFFFF
} DISPLAYCONFIG_DEVICE_INFO_TYPE;

Why use a code available in the official Microsoft SDK is now a hack?

Last edited by pistacho; 29th January 2020 at 18:59.
pistacho is offline   Reply With Quote