Update to v2.0.0 and added functions

Decided that the DisplayProfile changes would
have to be breaking changes if I was going to
add HDR support, and be able to handle adding
future video cards from different manufacturers.
This all requires a change to the DisplayProfile
format. So now this is going to use a file called
DisplayProfiles_2.0.json rather than a file called
DisplayProfiles_1.0.json. This is because the
profiles will need to be generated again from
scratch, as they will all be completely different
to the format in DisplayProfiles_1.0.json.
This commit is contained in:
Terry MacDonald 2021-06-20 16:37:00 +12:00
parent 4774b9a995
commit 7efd4f0349
6 changed files with 84 additions and 28 deletions

View File

@ -37,8 +37,8 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")] [assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyFileVersion("2.0.0.0")]
[assembly: NeutralResourcesLanguage("en")] [assembly: NeutralResourcesLanguage("en")]
[assembly: CLSCompliant(true)] [assembly: CLSCompliant(true)]

View File

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")] [assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyFileVersion("2.0.0.0")]

View File

@ -4,8 +4,8 @@
Versioning. These have to be changed for upgrades. Versioning. These have to be changed for upgrades.
It's not enough to just include newer files. It's not enough to just include newer files.
--> -->
<?define MajorVersion="1" ?> <?define MajorVersion="2" ?>
<?define MinorVersion="2" ?> <?define MinorVersion="0" ?>
<?define PatchVersion="0" ?> <?define PatchVersion="0" ?>
<!-- Revision is NOT used by WiX in the upgrade procedure --> <!-- Revision is NOT used by WiX in the upgrade procedure -->
<!-- Full version number to display --> <!-- Full version number to display -->

View File

@ -302,6 +302,26 @@ namespace ATI.ADL
/// <summary> Screen resolution Height. </summary> /// <summary> Screen resolution Height. </summary>
internal int YRes; internal int YRes;
} }
internal struct ConvertedDisplayModeFlags
{
/// <summary> Indicates the display supports Colour Format 565.</summary>
internal bool COLOURFORMAT_565;
/// <summary> Indicates the display supports Colour Format 8888.</summary>
internal bool COLOURFORMAT_8888;
/// <summary> Indicates the display supports normal vertical orientation</summary>
internal bool ORIENTATION_SUPPORTED_000;
/// <summary> Indicates the display supports 90 degree orientation</summary>
internal bool ORIENTATION_SUPPORTED_090;
/// <summary> Indicates the display supports 180 degree orientation</summary>
internal bool ORIENTATION_SUPPORTED_180;
/// <summary> Indicates the display supports 270 degree orientation</summary>
internal bool ORIENTATION_SUPPORTED_270;
/// <summary> Indicates the display supports rounded refresh rates</summary>
internal bool REFRESHRATE_ROUNDED;
/// <summary> Indicates the display supports exact refresh rates</summary>
internal bool REFRESHRATE_ONLY;
}
#endregion ADLMode #endregion ADLMode
#region ADLDisplayTarget #region ADLDisplayTarget
@ -1171,32 +1191,22 @@ namespace ATI.ADL
USBTypeC = 18 USBTypeC = 18
} }
internal enum ADLDisplayModeColourFormat internal enum ADLDisplayModeFlag
{ {
ColourFormat565 = 1, ColourFormat565 = 1,
ColourFormat8888 = 2 ColourFormat8888 = 2,
Degrees0 = 4,
Degrees90 = 8,
Degrees180 = 10,
Degrees270 = 20,
ExactRefreshRate = 80,
RoundedRefreshRate = 40
} }
internal enum ADLDisplayModeInterlacing internal enum ADLDisplayModeInterlacing
{ {
Progressive = 0, Progressive = 0,
Interlaced = 2 Interlaced = 2
} }
internal enum ADLDisplayModeOrientation
{
Degrees0 = 4,
Degrees90 = 8,
Degrees180 = 10,
Degrees270 = 20
}
internal enum ADLDisplayModeRefreshRate
{
ExactRefreshRate = 80,
RoundedRefreshRate = 40
}
#endregion Internal Enums #endregion Internal Enums
#region Class ADLImport #region Class ADLImport
@ -2173,6 +2183,40 @@ namespace ATI.ADL
} }
internal static ConvertedDisplayModeFlags ConvertDisplayModeFlags(int displayModeFlag)
{
ConvertedDisplayModeFlags expandedDisplayModeFlags = new ConvertedDisplayModeFlags();
// Indicates the display is a digital device
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_COLOURFORMAT_565) == ADL.ADL_DISPLAY_MODE_COLOURFORMAT_565)
expandedDisplayModeFlags.COLOURFORMAT_565 = true;
// Indicates the display supports EDID queries
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_COLOURFORMAT_8888) == ADL.ADL_DISPLAY_MODE_COLOURFORMAT_8888)
expandedDisplayModeFlags.COLOURFORMAT_8888 = true;
// Indicates the display supports normal vertical orientation
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_000) == ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_000)
expandedDisplayModeFlags.ORIENTATION_SUPPORTED_000 = true;
// Indicates the display supports normal vertical orientation
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_090) == ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_090)
expandedDisplayModeFlags.ORIENTATION_SUPPORTED_090 = true;
// Indicates the display supports normal vertical orientation
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_180) == ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_180)
expandedDisplayModeFlags.ORIENTATION_SUPPORTED_180 = true;
// Indicates the display supports normal vertical orientation
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_270) == ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_270)
expandedDisplayModeFlags.ORIENTATION_SUPPORTED_270 = true;
// Indicates the display supports normal vertical orientation
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_REFRESHRATE_ROUNDED) == ADL.ADL_DISPLAY_MODE_REFRESHRATE_ROUNDED)
expandedDisplayModeFlags.REFRESHRATE_ROUNDED = true;
// Indicates the display supports normal vertical orientation
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_REFRESHRATE_ONLY) == ADL.ADL_DISPLAY_MODE_REFRESHRATE_ONLY)
expandedDisplayModeFlags.REFRESHRATE_ONLY = true;
return expandedDisplayModeFlags;
}
internal static string ConvertADLReturnValueIntoWords(int adlReturnValue) internal static string ConvertADLReturnValueIntoWords(int adlReturnValue)
{ {
if (adlReturnValue == ADL.ADL_OK) if (adlReturnValue == ADL.ADL_OK)

View File

@ -30,6 +30,8 @@ namespace DisplayMagicianShared.AMD
// Struct to be used as the AMD Profile // Struct to be used as the AMD Profile
public struct AMDProfile public struct AMDProfile
{ {
ADLMode DisplayMode;
int XPos; int XPos;
int YPos; int YPos;
} }
@ -1205,7 +1207,6 @@ namespace DisplayMagicianShared.AMD
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: Display Info Value NONLOCAL = {displayInfoValue.NONLOCAL}"); SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: Display Info Value NONLOCAL = {displayInfoValue.NONLOCAL}");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: Display Info Value SHOWTYPE_PROJECTOR = {displayInfoValue.SHOWTYPE_PROJECTOR}"); SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: Display Info Value SHOWTYPE_PROJECTOR = {displayInfoValue.SHOWTYPE_PROJECTOR}");
ADL.ADLDisplayConnectionType displayConnectionType = ADL.ADLDisplayConnectionType.Unknown;
ADLMode oneDisplayMode = new ADLMode(); ADLMode oneDisplayMode = new ADLMode();
IntPtr displayModeBuffer = IntPtr.Zero; IntPtr displayModeBuffer = IntPtr.Zero;
int numModes = 0; int numModes = 0;
@ -1220,10 +1221,21 @@ namespace DisplayMagicianShared.AMD
oneDisplayMode = (ADLMode)Marshal.PtrToStructure(new IntPtr(displayModeBuffer.ToInt64() + (displayModeLoop * Marshal.SizeOf(oneDisplayMode))), oneDisplayMode.GetType()); oneDisplayMode = (ADLMode)Marshal.PtrToStructure(new IntPtr(displayModeBuffer.ToInt64() + (displayModeLoop * Marshal.SizeOf(oneDisplayMode))), oneDisplayMode.GetType());
//displayConnectionType = (ADL.ADLDisplayConnectionType)displayConfig.ConnectorType; //displayConnectionType = (ADL.ADLDisplayConnectionType)displayConfig.ConnectorType;
ConvertedDisplayModeFlags displayModeFlag = ADL.ConvertDisplayModeFlags(oneDisplayMode.ModeFlag);
ConvertedDisplayModeFlags displayModeMask = ADL.ConvertDisplayModeFlags(oneDisplayMode.ModeMask);
ConvertedDisplayModeFlags displayModeValue = ADL.ConvertDisplayModeFlags(oneDisplayMode.ModeValue);
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: ### Display Modes for Display #{oneDisplayInfo.DisplayID.DisplayLogicalIndex} on Adapter #{oneAdapter.AdapterIndex} ###"); SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: ### Display Modes for Display #{oneDisplayInfo.DisplayID.DisplayLogicalIndex} on Adapter #{oneAdapter.AdapterIndex} ###");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Colour Depth = {oneDisplayMode.ColourDepth}"); SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Colour Depth = {oneDisplayMode.ColourDepth}");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Flag = {oneDisplayMode.ModeFlag}"); SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Flag = {oneDisplayMode.ModeFlag}");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Flag ColourFormat 565 = {displayModeFlag.COLOURFORMAT_565}");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Flag ColourFormat 8888 = {displayModeFlag.COLOURFORMAT_8888}");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Flag ORIENTATION_SUPPORTED_000 = {displayModeFlag.ORIENTATION_SUPPORTED_000}");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Flag ORIENTATION_SUPPORTED_090 = {displayModeFlag.ORIENTATION_SUPPORTED_090}");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Flag ORIENTATION_SUPPORTED_180 = {displayModeFlag.ORIENTATION_SUPPORTED_180}");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Flag ORIENTATION_SUPPORTED_270 = {displayModeFlag.ORIENTATION_SUPPORTED_270}");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Flag REFRESHRATE_ROUNDED = {displayModeFlag.REFRESHRATE_ROUNDED}");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Flag REFRESHRATE_ONLY = {displayModeFlag.REFRESHRATE_ONLY}");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Mask = {oneDisplayMode.ModeMask}"); SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Mask = {oneDisplayMode.ModeMask}");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Value = {oneDisplayMode.ModeValue}"); SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Mode Value = {oneDisplayMode.ModeValue}");
SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Orientation = {oneDisplayMode.Orientation}"); SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: DisplayMode Orientation = {oneDisplayMode.Orientation}");

View File

@ -35,5 +35,5 @@ using System.Runtime.InteropServices;
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.2.0.0")] [assembly: AssemblyVersion("2.0.0.0")]
[assembly: AssemblyFileVersion("1.2.0.0")] [assembly: AssemblyFileVersion("2.0.0.0")]