From 04a0b56b59d63800c977d557bde11c8486d7e1e3 Mon Sep 17 00:00:00 2001 From: Terry MacDonald Date: Sun, 27 Jun 2021 13:53:00 +1200 Subject: [PATCH] [WIP] Basic working DisplayProfile writing and reading Now have the DisplayProfile storing the minimal set of data that it needs. It also recreates the Screens list (used for creating profile bitmaps and icons) and recreates the DisplayProfileBitmaps each time at present. I will add some logic to deerialise the bitmaps again at a later date once I've compeleted actually applying the AMD display confs. --- DisplayMagicianShared/AMD/ADL.cs | 928 ++++++++++---------- DisplayMagicianShared/AMD/AMDLibrary.cs | 175 +--- DisplayMagicianShared/AMD/AMDProfileItem.cs | 125 ++- DisplayMagicianShared/ProfileIcon.cs | 111 ++- DisplayMagicianShared/ProfileItem.cs | 29 +- DisplayMagicianShared/ProfileRepository.cs | 24 +- 6 files changed, 736 insertions(+), 656 deletions(-) diff --git a/DisplayMagicianShared/AMD/ADL.cs b/DisplayMagicianShared/AMD/ADL.cs index 65e9400..2bf35cd 100644 --- a/DisplayMagicianShared/AMD/ADL.cs +++ b/DisplayMagicianShared/AMD/ADL.cs @@ -40,7 +40,7 @@ namespace ATI.ADL /// ADL Memory allocation function allows ADL to callback for memory allocation /// input size /// retrun ADL Error Code - internal delegate IntPtr ADL_Main_Memory_Alloc (int size); + public delegate IntPtr ADL_Main_Memory_Alloc (int size); // ADL2 version of function delagates @@ -49,17 +49,17 @@ namespace ATI.ADL /// If it is 1, then ADL will only retuen the physical exist adapters /// Handle to ADL client context. /// retrun ADL Error Code - internal delegate int ADL2_Main_Control_Create(ADL_Main_Memory_Alloc callback, int numConnectedAdapters, out IntPtr contextHandle); + public delegate int ADL2_Main_Control_Create(ADL_Main_Memory_Alloc callback, int numConnectedAdapters, out IntPtr contextHandle); /// ADL2 Destroy Function to free up ADL Data /// Handle to ADL client context. /// retrun ADL Error Code - internal delegate int ADL2_Main_Control_Destroy(IntPtr contextHandle); + public delegate int ADL2_Main_Control_Destroy(IntPtr contextHandle); /// ADL2 Function to get the number of adapters /// Handle to ADL client context. /// return number of adapters - internal delegate int ADL2_Adapter_NumberOfAdapters_Get(IntPtr ADLContextHandle, ref int numAdapters); + public delegate int ADL2_Adapter_NumberOfAdapters_Get(IntPtr ADLContextHandle, ref int numAdapters); /// ADL2 Function to determine if the adapter is active or not. /// The function is used to check if the adapter associated with iAdapterIndex is active @@ -67,7 +67,7 @@ namespace ATI.ADL /// Adapter Index. /// Status of the adapter. True: Active; False: Disabled /// Non zero is successful - internal delegate int ADL2_Adapter_Active_Get(IntPtr ADLContextHandle, int adapterIndex, ref int status); + public delegate int ADL2_Adapter_Active_Get(IntPtr ADLContextHandle, int adapterIndex, ref int status); /// ADL2 Function to retrieve adapter capability information. /// This function implements a DI call to retrieve adapter capability information . @@ -75,7 +75,7 @@ namespace ATI.ADL /// Adapter Index. /// The pointer to the ADLAdapterCaps structure storing the retrieved adapter capability information. /// return ADL Error Code - internal delegate int ADL2_AdapterX2_Caps(IntPtr ADLContextHandle, int adapterIndex, out ADLAdapterCapsX2 adapterCapabilities); + public delegate int ADL2_AdapterX2_Caps(IntPtr ADLContextHandle, int adapterIndex, out ADLAdapterCapsX2 adapterCapabilities); /// ADL2 Function to retrieve all OS-known adapter information. @@ -84,14 +84,14 @@ namespace ATI.ADL /// return GPU adapter information /// the size of the GPU adapter struct /// retrun ADL Error Code - internal delegate int ADL2_Adapter_AdapterInfo_Get(IntPtr ADLContextHandle, int inputSize, out IntPtr adapterInfoArray); + public delegate int ADL2_Adapter_AdapterInfo_Get(IntPtr ADLContextHandle, int inputSize, out IntPtr adapterInfoArray); /// ADL2 function retrieves all OS-known adapter information. /// This function retrieves the adapter information of all OS-known adapters in the system. OS-known adapters can include adapters that are physically present in the system (logical adapters) as well as ones that are no longer present in the system but are still recognized by the OS. /// Handle to ADL client context. /// return GPU adapter information. Is a pointer to the pointer of AdapterInfo array. Initialize to NULL before calling this API. ADL will allocate the necessary memory, using the user provided callback function. /// retrun ADL Error Code - internal delegate int ADL2_Adapter_AdapterInfoX2_Get(IntPtr ADLContextHandle, out IntPtr adapterInfoArray); + public delegate int ADL2_Adapter_AdapterInfoX2_Get(IntPtr ADLContextHandle, out IntPtr adapterInfoArray); /// ADL2 function retrieves all OS-known adapter information. /// This function retrieves the adapter information of all OS-known adapters in the system. OS-known adapters can include adapters that are physically present in the system (logical adapters) as well as ones that are no longer present in the system but are still recognized by the OS. @@ -100,7 +100,7 @@ namespace ATI.ADL /// Number of items in the AdapterInfo Array. Can pass NULL pointer if passign an adapter index (in which case only one AdapterInfo is returned) /// return GPU adapter information /// retrun ADL Error Code - internal delegate int ADL2_Adapter_AdapterInfoX3_Get(IntPtr ADLContextHandle, int adapterIndex, out int numAdapters, out IntPtr adapterInfoArray); + public delegate int ADL2_Adapter_AdapterInfoX3_Get(IntPtr ADLContextHandle, int adapterIndex, out int numAdapters, out IntPtr adapterInfoArray); /// ADL2 function retrieves all OS-known adapter information. /// This function retrieves the adapter information of all OS-known adapters in the system. OS-known adapters can include adapters that are physically present in the system (logical adapters) as well as ones that are no longer present in the system but are still recognized by the OS. @@ -109,7 +109,7 @@ namespace ATI.ADL /// Number of items in the AdapterInfo Array. Can pass NULL pointer if passign an adapter index (in which case only one AdapterInfo is returned) /// return GPU adapter information in adapterInfoX2 array /// retrun ADL Error Code - internal delegate int ADL2_Adapter_AdapterInfoX4_Get(IntPtr ADLContextHandle, int adapterIndex, out int numAdapters, out IntPtr adapterInfoX2Array); + public delegate int ADL2_Adapter_AdapterInfoX4_Get(IntPtr ADLContextHandle, int adapterIndex, out int numAdapters, out IntPtr adapterInfoX2Array); /// ADL2 Create Function to create ADL Data /// Handle to ADL client context. @@ -117,7 +117,7 @@ namespace ATI.ADL /// Display Index /// The ADLDDCInfo2 structure storing all DDC retrieved from the driver. /// retrun ADL Error Code - internal delegate int ADL2_Display_DDCInfo2_Get(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, out ADLDDCInfo2 displayDDCInfo2); + public delegate int ADL2_Display_DDCInfo2_Get(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, out ADLDDCInfo2 displayDDCInfo2); /// ADL2 function to get display information based on adapter index /// Handle to ADL client context. @@ -126,7 +126,7 @@ namespace ATI.ADL /// return ADLDisplayInfo Array for supported displays' information /// force detect or not /// return ADL Error Code - internal delegate int ADL2_Display_DisplayInfo_Get(IntPtr ADLContextHandle, int adapterIndex, ref int numDisplays, out IntPtr displayInfoArray, int forceDetect); + public delegate int ADL2_Display_DisplayInfo_Get(IntPtr ADLContextHandle, int adapterIndex, ref int numDisplays, out IntPtr displayInfoArray, int forceDetect); /// This ADL2 function retrieves HDTV capability settings for a specified display. /// Handle to ADL client context. @@ -134,7 +134,7 @@ namespace ATI.ADL /// Display Index /// return ADLDisplayConfig with HDTV capability settings in it /// return ADL Error Code - internal delegate int ADL2_Display_DeviceConfig_Get(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, out ADLDisplayConfig displayConfig); + public delegate int ADL2_Display_DeviceConfig_Get(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, out ADLDisplayConfig displayConfig); /// ADL2 function to query whether a display is HDR Supported and Enabled /// Handle to ADL client context. @@ -143,7 +143,7 @@ namespace ATI.ADL /// return a pointer to the int whose value is set to true if the display supports HDR /// return a pointer to the int whose value is set to true if HDR is enabled on this display /// return ADL Error Code - internal delegate int ADL2_Display_HDRState_Get(IntPtr ADLContextHandle, int adapterIndex, ADLDisplayID displayID, out int support, out int enable); + public delegate int ADL2_Display_HDRState_Get(IntPtr ADLContextHandle, int adapterIndex, ADLDisplayID displayID, out int support, out int enable); /// ADL2 function to retrieve the current display mode information /// Handle to ADL client context. @@ -152,7 +152,7 @@ namespace ATI.ADL /// return a pointer to the number of modes retrieved. /// return a pointer to the array of retrieved ADLMode display modes. /// return ADL Error Code - internal delegate int ADL2_Display_Modes_Get(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, out int numModes, out IntPtr modes); + public delegate int ADL2_Display_Modes_Get(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, out int numModes, out IntPtr modes); // ADL version of function delagates @@ -161,44 +161,44 @@ namespace ATI.ADL /// Call back functin pointer which is ised to allocate memeory /// If it is 1, then ADL will only retuen the physical exist adapters /// retrun ADL Error Code - internal delegate int ADL_Main_Control_Create(ADL_Main_Memory_Alloc callback, int enumConnectedAdapters); + public delegate int ADL_Main_Control_Create(ADL_Main_Memory_Alloc callback, int enumConnectedAdapters); /// ADL Destroy Function to free up ADL Data /// retrun ADL Error Code - internal delegate int ADL_Main_Control_Destroy (); + public delegate int ADL_Main_Control_Destroy (); /// ADL Function to get the number of adapters /// return number of adapters /// retrun ADL Error Code - internal delegate int ADL_Adapter_NumberOfAdapters_Get (ref int numAdapters); + public delegate int ADL_Adapter_NumberOfAdapters_Get (ref int numAdapters); /// Function to determine if the adapter is active or not. /// The function is used to check if the adapter associated with iAdapterIndex is active /// Adapter Index. /// Status of the adapter. True: Active; False: Disabled /// Non zero is successful - internal delegate int ADL_Adapter_Active_Get(int adapterIndex, ref int status); + public delegate int ADL_Adapter_Active_Get(int adapterIndex, ref int status); /// Function to get the unique identifier of an adapter. /// This function retrieves the unique identifier of a specified adapter. The adapter ID is a unique value and will be used to determine what other controllers share the same adapter. The desktop will use this to find which HDCs are associated with an adapter. /// Adapter Index. /// The pointer to the adapter identifier. Zero means: The adapter is not AMD. /// return ADL Error Code - internal delegate int ADL_Adapter_ID_Get(int adapterIndex, ref int adapterId); + public delegate int ADL_Adapter_ID_Get(int adapterIndex, ref int adapterId); /// Function to retrieve adapter capability information. /// This function implements a DI call to retrieve adapter capability information . /// Adapter Index. /// The pointer to the ADLAdapterCaps structure storing the retrieved adapter capability information. /// return ADL Error Code - internal delegate int ADL_AdapterX2_Caps(int adapterIndex, out ADLAdapterCapsX2 adapterCapabilities); + public delegate int ADL_AdapterX2_Caps(int adapterIndex, out ADLAdapterCapsX2 adapterCapabilities); /// Retrieves all OS-known adapter information. /// This function retrieves the adapter information of all OS-known adapters in the system. OS-known adapters can include adapters that are physically present in the system (logical adapters) as well as ones that are no longer present in the system but are still recognized by the OS. /// return GPU adapter information /// the size of the GPU adapter struct /// retrun ADL Error Code - internal delegate int ADL_Adapter_AdapterInfo_Get(out IntPtr adapterInfoArray, int inputSize); + public delegate int ADL_Adapter_AdapterInfo_Get(out IntPtr adapterInfoArray, int inputSize); /// Function to get the EDID data. @@ -207,7 +207,7 @@ namespace ATI.ADL /// The desired display index. It can be retrieved from the ADLDisplayInfo data structure. /// return the ADLDisplayEDIDData structure storing the retrieved EDID data. /// return ADL Error Code - internal delegate int ADL_Display_EdidData_Get(int adapterIndex, int displayIndex, ref ADLDisplayEDIDData EDIDData); + public delegate int ADL_Display_EdidData_Get(int adapterIndex, int displayIndex, ref ADLDisplayEDIDData EDIDData); /// Get display information based on adapter index /// Adapter Index @@ -215,14 +215,14 @@ namespace ATI.ADL /// return ADLDisplayInfo Array for supported displays' information /// force detect or not /// return ADL Error Code - internal delegate int ADL_Display_DisplayInfo_Get(int adapterIndex, ref int numDisplays, out IntPtr displayInfoArray, int forceDetect); + public delegate int ADL_Display_DisplayInfo_Get(int adapterIndex, ref int numDisplays, out IntPtr displayInfoArray, int forceDetect); /// This function retrieves HDTV capability settings for a specified display. /// Adapter Index /// Display Index /// return ADLDisplayConfig with HDTV capability settings in it /// return ADL Error Code - internal delegate int ADL_Display_DeviceConfig_Get(int adapterIndex, int displayIndex, out ADLDisplayConfig displayConfig); + public delegate int ADL_Display_DeviceConfig_Get(int adapterIndex, int displayIndex, out ADLDisplayConfig displayConfig); /// Function to retrieve current display map configurations. /// This function retrieves the current display map configurations, including the controllers and adapters mapped to each display. @@ -233,7 +233,7 @@ namespace ATI.ADL /// Array of ADLDisplayTarget objects /// Options supplied /// return ADL Error Code - internal delegate int ADL_Display_DisplayMapConfig_Get(int adapterIndex, out int numDisplayMap, out IntPtr displayMap, out int numDisplayTarget, out IntPtr displayTarget, int options); + public delegate int ADL_Display_DisplayMapConfig_Get(int adapterIndex, out int numDisplayMap, out IntPtr displayMap, out int numDisplayTarget, out IntPtr displayTarget, int options); /// Function to validate a list of display configurations. /// This function allows the user to input a potential displays map and its targets. The function can also be used to obtain a list of display targets that can be added to this given topology and a list of display targets that can be removed from this given topology. @@ -247,7 +247,7 @@ namespace ATI.ADL /// Number of Display Map /// Number of Display Map /// return ADL Error Code - internal delegate int ADL_Display_DisplayMapConfig_PossibleAddAndRemove(int adapterIndex, int numDisplayMap, ADLDisplayMap displayMap, int numDisplayTarget, ADLDisplayTarget displayTarget, out int numPossibleAddTarget, out IntPtr possibleAddTarget, out int numPossibleRemoveTarget, out IntPtr possibleRemoveTarget); + public delegate int ADL_Display_DisplayMapConfig_PossibleAddAndRemove(int adapterIndex, int numDisplayMap, ADLDisplayMap displayMap, int numDisplayTarget, ADLDisplayTarget displayTarget, out int numPossibleAddTarget, out IntPtr possibleAddTarget, out int numPossibleRemoveTarget, out IntPtr possibleRemoveTarget); /// Function to retrieve an SLS configuration. /// Adapter Index @@ -265,7 +265,7 @@ namespace ATI.ADL /// return ADLSLSOffset Array that contains the SLS offsets /// Specifies the layout type of SLS grid data. It is bit vector. There are two types of SLS layout:s, relative to landscape (ref \ADL_DISPLAY_SLSGRID_CAP_OPTION_RELATIVETO_LANDSCAPE) and relative to current angle (ref \ADL_DISPLAY_SLSGRID_CAP_OPTION_RELATIVETO_CURRENTANGLE). /// return ADL Error Code - internal delegate int ADL_Display_SLSMapConfig_Get(int adapterIndex, int SLSMapIndex, ref ADLSLSMap SLSMap, ref int numSLSTarget, out IntPtr SLSTargetArray, ref int numNativeMode, + public delegate int ADL_Display_SLSMapConfig_Get(int adapterIndex, int SLSMapIndex, ref ADLSLSMap SLSMap, ref int numSLSTarget, out IntPtr SLSTargetArray, ref int numNativeMode, out IntPtr SLSNativeMode, ref int numBezelMode, out IntPtr SLSBezelMode, ref int numTransientMode, out IntPtr SLSTransientMode, ref int numSLSOffset, out IntPtr SLSOffset, int option); #endregion Export Delegates @@ -275,177 +275,177 @@ namespace ATI.ADL #region ADLMode /// ADLAdapterInfo Array [StructLayout(LayoutKind.Sequential)] - internal struct ADLMode + public struct ADLMode { /// Adapter index. - internal int AdapterIndex; + public int AdapterIndex; /// Display IDs. - internal ADLDisplayID DisplayID; + public ADLDisplayID DisplayID; /// Screen position X coordinate. - internal int XPos; + public int XPos; /// Screen position Y coordinate. - internal int YPos; + public int YPos; /// Screen resolution Width. - internal int XRes; + public int XRes; /// Screen resolution Height. - internal int YRes; + public int YRes; /// Screen Color Depth. E.g., 16, 32. - internal int ColourDepth; + public int ColourDepth; /// Screen refresh rate. - internal float RefreshRate; + public float RefreshRate; /// Screen orientation. E.g., 0, 90, 180, 270. - internal int Orientation; + public int Orientation; /// Vista mode flag indicating Progressive or Interlaced mode. - internal int ModeFlag; + public int ModeFlag; /// The bit mask identifying the number of bits this Mode is currently using. - internal int ModeMask; + public int ModeMask; /// The bit mask identifying the display status. - internal int ModeValue; + public int ModeValue; } - internal struct ConvertedDisplayModeFlags + public struct ConvertedDisplayModeFlags { /// Indicates the display supports Colour Format 565. - internal bool COLOURFORMAT_565; + public bool COLOURFORMAT_565; /// Indicates the display supports Colour Format 8888. - internal bool COLOURFORMAT_8888; + public bool COLOURFORMAT_8888; /// Indicates the display supports normal vertical orientation - internal bool ORIENTATION_SUPPORTED_000; + public bool ORIENTATION_SUPPORTED_000; /// Indicates the display supports 90 degree orientation - internal bool ORIENTATION_SUPPORTED_090; + public bool ORIENTATION_SUPPORTED_090; /// Indicates the display supports 180 degree orientation - internal bool ORIENTATION_SUPPORTED_180; + public bool ORIENTATION_SUPPORTED_180; /// Indicates the display supports 270 degree orientation - internal bool ORIENTATION_SUPPORTED_270; + public bool ORIENTATION_SUPPORTED_270; /// Indicates the display supports rounded refresh rates - internal bool REFRESHRATE_ROUNDED; + public bool REFRESHRATE_ROUNDED; /// Indicates the display supports exact refresh rates - internal bool REFRESHRATE_ONLY; + public bool REFRESHRATE_ONLY; } #endregion ADLMode #region ADLDisplayTarget /// ADLDisplayTarget [StructLayout(LayoutKind.Sequential)] - internal struct ADLDisplayTarget + public struct ADLDisplayTarget { /// Display IDs. - internal ADLDisplayID DisplayID; + public ADLDisplayID DisplayID; /// The display map index identify this manner and the desktop surface. - internal int DisplayMapIndex; + public int DisplayMapIndex; /// The bit mask identifies the number of bits DisplayTarget is currently using. - internal int DisplayTargetMask; + public int DisplayTargetMask; /// The bit mask identifies the display status. - internal int DisplayTargetValue; + public int DisplayTargetValue; } /// ADLDisplayTargetArray Array [StructLayout(LayoutKind.Sequential)] - internal struct ADLDisplayTargetArray + public struct ADLDisplayTargetArray { /// ADLDisplayTarget Array [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)ADL.ADL_MAX_DISPLAYS)] - internal ADLDisplayTarget[] ADLDisplayTarget; + public ADLDisplayTarget[] ADLDisplayTarget; } #endregion ADLDisplayTarget #region ADLAdapterInfo /// ADLAdapterInfo Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLAdapterInfo + public struct ADLAdapterInfo { /// The size of the structure int Size; /// Adapter Index - internal int AdapterIndex; + public int AdapterIndex; /// Adapter UDID [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)] - internal string UDID; + public string UDID; /// Adapter Bus Number - internal int BusNumber; + public int BusNumber; /// Adapter Driver Number - internal int DriverNumber; + public int DriverNumber; /// Adapter Function Number - internal int FunctionNumber; + public int FunctionNumber; /// Adapter Vendor ID - internal int VendorID; + public int VendorID; /// Adapter Adapter name [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)] - internal string AdapterName; + public string AdapterName; /// Adapter Display name [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)] - internal string DisplayName; + public string DisplayName; /// Adapter Present status - internal int Present; + public int Present; /// Adapter Exist status - internal int Exist; + public int Exist; /// Adapter Driver Path [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)] - internal string DriverPath; + public string DriverPath; /// Adapter Driver Ext Path [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)] - internal string DriverPathExt; + public string DriverPathExt; /// Adapter PNP String [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)] - internal string PNPString; + public string PNPString; /// OS Display Index - internal int OSDisplayIndex; + public int OSDisplayIndex; } /// ADLAdapterInfo Array [StructLayout(LayoutKind.Sequential)] - internal struct ADLAdapterInfoArray + public struct ADLAdapterInfoArray { /// ADLAdapterInfo Array [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)ADL.ADL_MAX_ADAPTERS)] - internal ADLAdapterInfo[] ADLAdapterInfo; + public ADLAdapterInfo[] ADLAdapterInfo; } /// ADLAdapterInfoX2 Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLAdapterInfoX2 + public struct ADLAdapterInfoX2 { /// The size of the structure - internal int Size; + public int Size; /// Adapter Index - internal int AdapterIndex; + public int AdapterIndex; /// Adapter UDID [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)] - internal string UDID; + public string UDID; /// Adapter Bus Number - internal int BusNumber; + public int BusNumber; /// Adapter Device Number - internal int DeviceNumber; + public int DeviceNumber; /// Adapter Function Number - internal int FunctionNumber; + public int FunctionNumber; /// Adapter Vendor ID - internal int VendorID; + public int VendorID; /// Adapter Adapter name [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_DISPLAY_NAME)] - internal string AdapterName; + public string AdapterName; /// Adapter Display name [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_DISPLAY_NAME)] - internal string DisplayName; + public string DisplayName; /// Adapter Present status - internal int Present; + public int Present; /// Adapter Exist status - internal int Exist; + public int Exist; /// Adapter Driver Path [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)] - internal string DriverPath; + public string DriverPath; /// Adapter Driver Ext Path [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)] - internal string DriverPathExt; + public string DriverPathExt; /// Adapter PNP String [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)] - internal string PNPString; + public string PNPString; /// OS Display Index - internal int OSDisplayIndex; + public int OSDisplayIndex; /// Display Info Mask - internal int InfoMask; + public int InfoMask; /// Display Info Value - internal int InfoValue; + public int InfoValue; } #endregion ADLAdapterInfo @@ -455,282 +455,282 @@ namespace ATI.ADL /// ADLDisplayEDIDData Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLDisplayEDIDData + public struct ADLDisplayEDIDData { /// Size - internal int Size; + public int Size; /// Flag - internal int Flag; + public int Flag; /// EDIDSize - internal int EDIDSize; + public int EDIDSize; /// Block Index - internal int BlockIndex; + public int BlockIndex; /// EDIDData [256] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_EDIDDATA_SIZE)] - internal string EDIDData; + public string EDIDData; [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - internal int[] Reserved; + public int[] Reserved; } /// ADLDDCInfo2 Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLDDCInfo2 + public struct ADLDDCInfo2 { /// Size of the structure. - internal int Size; + public int Size; /// Whether this display device support DDC - internal int SupportsDDC; + public int SupportsDDC; /// Returns the manufacturer ID of the display device. Should be zeroed if this information is not available. - internal int ManufacturerID; + public int ManufacturerID; /// Returns the product ID of the display device. Should be zeroed if this informatiadlon is not available. - internal int ProductID; + public int ProductID; /// Returns the name of the display device. Should be zeroed if this information is not available. [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_DISPLAY_NAME)] - internal string DisplayName; + public string DisplayName; /// Returns the maximum Horizontal supported resolution. Should be zeroed if this information is not available. - internal int MaxHResolution; + public int MaxHResolution; /// Returns the maximum Vertical supported resolution. Should be zeroed if this information is not available. - internal int MaxVResolution; + public int MaxVResolution; /// Returns the maximum supported refresh rate. Should be zeroed if this information is not available. - internal int MaxRefresh; + public int MaxRefresh; /// Returns the display device preferred timing mode's horizontal resolution. - internal int PTMCx; + public int PTMCx; /// Returns the display device preferred timing mode's vertical resolution. - internal int PTMCy; + public int PTMCy; /// Returns the display device preferred timing mode's refresh rate. - internal int PTMRefreshRate; + public int PTMRefreshRate; /// Return EDID flags. - internal int DDCInfoFlag; + public int DDCInfoFlag; /// Returns 1 if the display supported packed pixel, 0 otherwise. - internal int PackedPixelSupported; + public int PackedPixelSupported; /// Returns the Pixel formats the display supports DDCInfo Pixel Formats. - internal int PanelPixelFormat; + public int PanelPixelFormat; /// Return EDID serial ID. - internal int SerialID; + public int SerialID; /// Return minimum monitor luminance data. - internal int MinLuminanceData; + public int MinLuminanceData; /// Return average monitor luminance data. - internal int AvgLuminanceData; + public int AvgLuminanceData; /// Return maximum monitor luminance data. - internal int MaxLuminanceData; + public int MaxLuminanceData; /// Bit vector of supported transfer functions ADLSourceContentAttributes transfer functions (gamma). - internal int SupportedTransferFunction; + public int SupportedTransferFunction; /// Bit vector of supported color spaces ADLSourceContentAttributes color spaces. - internal int SupportedColorSpace; + public int SupportedColorSpace; /// Display Red Chromaticity X coordinate multiplied by 10000. - internal int NativeDisplayChromaticityRedX; + public int NativeDisplayChromaticityRedX; /// Display Red Chromaticity Y coordinate multiplied by 10000. - internal int NativeDisplayChromaticityRedY; + public int NativeDisplayChromaticityRedY; /// Display Green Chromaticity X coordinate multiplied by 10000. - internal int NativeDisplayChromaticityGreenX; + public int NativeDisplayChromaticityGreenX; /// Display Green Chromaticity Y coordinate multiplied by 10000. - internal int NativeDisplayChromaticityGreenY; + public int NativeDisplayChromaticityGreenY; /// Display Blue Chromaticity X coordinate multiplied by 10000. - internal int NativeDisplayChromaticityBlueX; + public int NativeDisplayChromaticityBlueX; /// Display Blue Chromaticity Y coordinate multiplied by 10000. - internal int NativeDisplayChromaticityBlueY; + public int NativeDisplayChromaticityBlueY; /// Display White Chromaticity X coordinate multiplied by 10000. - internal int NativeDisplayChromaticityWhiteX; + public int NativeDisplayChromaticityWhiteX; /// Display White Chromaticity Y coordinate multiplied by 10000. - internal int NativeDisplayChromaticityWhiteY; + public int NativeDisplayChromaticityWhiteY; /// Display diffuse screen reflectance 0-1 (100%) in units of 0.01. - internal int DiffuseScreenReflectance; + public int DiffuseScreenReflectance; /// Display specular screen reflectance 0-1 (100%) in units of 0.01. - internal int SpecularScreenReflectance; + public int SpecularScreenReflectance; /// Bit vector of supported color spaces ADLDDCInfo2 HDR support options. - internal int SupportedHDR; + public int SupportedHDR; /// Bit vector for freesync flags. - internal int FreesyncFlags; + public int FreesyncFlags; /// Return minimum monitor luminance without dimming data. - internal int MinLuminanceNoDimmingData; + public int MinLuminanceNoDimmingData; /// Returns the maximum backlight maximum luminance. Should be zeroed if this information is not available. - internal int MaxBacklightMaxLuminanceData; + public int MaxBacklightMaxLuminanceData; /// Returns the minimum backlight maximum luminance. Should be zeroed if this information is not available. - internal int MinBacklightMaxLuminanceData; + public int MinBacklightMaxLuminanceData; /// Returns the maximum backlight minimum luminance. Should be zeroed if this information is not available. - internal int MaxBacklightMinLuminanceData; + public int MaxBacklightMinLuminanceData; /// Returns the minimum backlight maximum luminance. Should be zeroed if this information is not available. - internal int MinBacklightMinLuminanceData; + public int MinBacklightMinLuminanceData; /// Reserved [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - internal int[] Reserved; + public int[] Reserved; } - internal struct ConvertedDDCInfoFlag + public struct ConvertedDDCInfoFlag { /// Indicates the display is a projector . - internal bool PROJECTORDEVICE; + public bool PROJECTORDEVICE; /// Indicates the display has an EDID extension - internal bool EDIDEXTENSION; + public bool EDIDEXTENSION; /// Indicates the display is a digital device - internal bool DIGITALDEVICE; + public bool DIGITALDEVICE; /// Indicates the display has HDMI audio capabilities - internal bool HDMIAUDIODEVICE; + public bool HDMIAUDIODEVICE; /// Indicates the display supports AI - internal bool SUPPORTS_AI; + public bool SUPPORTS_AI; /// Indicates the display supports xvYCC601 - internal bool SUPPORT_xvYCC601; + public bool SUPPORT_xvYCC601; /// Indicates the display supports xvYCC709 - internal bool SUPPORT_xvYCC709; + public bool SUPPORT_xvYCC709; } - internal struct ConvertedSupportedHDR + public struct ConvertedSupportedHDR { /// HDR10/CEA861.3 HDR supported - internal bool CEA861_3; + public bool CEA861_3; /// DolbyVision HDR supported - internal bool DOLBYVISION; + public bool DOLBYVISION; /// FreeSync HDR supported. - internal bool FREESYNC_HDR; + public bool FREESYNC_HDR; } /// ADLDisplayID Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLDisplayID + public struct ADLDisplayID { /// Display Logical Index - internal int DisplayLogicalIndex; + public int DisplayLogicalIndex; /// Display Physical Index - internal int DisplayPhysicalIndex; + public int DisplayPhysicalIndex; /// Adapter Logical Index - internal int DisplayLogicalAdapterIndex; + public int DisplayLogicalAdapterIndex; /// Adapter Physical Index - internal int DisplayPhysicalAdapterIndex; + public int DisplayPhysicalAdapterIndex; } /// ADLDisplayInfo Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLDisplayInfo + public struct ADLDisplayInfo { /// Display Index - internal ADLDisplayID DisplayID; + public ADLDisplayID DisplayID; /// Display Controller Index - internal int DisplayControllerIndex; + public int DisplayControllerIndex; /// Display Name [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)] - internal string DisplayName; + public string DisplayName; /// Display Manufacturer Name [MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)] - internal string DisplayManufacturerName; + public string DisplayManufacturerName; /// Display Type : < The Display type. CRT, TV,CV,DFP are some of display types, - internal int DisplayType; + public int DisplayType; /// Display output type - internal int DisplayOutputType; + public int DisplayOutputType; /// Connector type - internal int DisplayConnector; + public int DisplayConnector; /// Indicating the display info bits' mask. - internal int DisplayInfoMask; + public int DisplayInfoMask; /// Indicating the display info value. - internal int DisplayInfoValue; + public int DisplayInfoValue; } - internal struct ConvertedDisplayInfoValue + public struct ConvertedDisplayInfoValue { /// Indicates the display is connected . - internal bool DISPLAYCONNECTED; + public bool DISPLAYCONNECTED; /// Indicates the display is mapped within OS - internal bool DISPLAYMAPPED; + public bool DISPLAYMAPPED; /// Indicates the display can be forced - internal bool FORCIBLESUPPORTED; + public bool FORCIBLESUPPORTED; /// Indicates the display supports genlock - internal bool GENLOCKSUPPORTED; + public bool GENLOCKSUPPORTED; /// Indicates the display is an LDA display. - internal bool LDA_DISPLAY; + public bool LDA_DISPLAY; /// Indicates the display supports 2x Horizontal stretch - internal bool MANNER_SUPPORTED_2HSTRETCH; + public bool MANNER_SUPPORTED_2HSTRETCH; /// - internal bool MANNER_SUPPORTED_2VSTRETCH; + public bool MANNER_SUPPORTED_2VSTRETCH; /// Indicates the display supports cloned desktops - internal bool MANNER_SUPPORTED_CLONE; + public bool MANNER_SUPPORTED_CLONE; /// Indicates the display supports extended desktops - internal bool MANNER_SUPPORTED_EXTENDED; + public bool MANNER_SUPPORTED_EXTENDED; /// Indicates the display supports N Stretched on 1 GPU - internal bool MANNER_SUPPORTED_NSTRETCH1GPU; + public bool MANNER_SUPPORTED_NSTRETCH1GPU; /// Indicates the display supports N Stretched on N GPUs - internal bool MANNER_SUPPORTED_NSTRETCHNGPU; + public bool MANNER_SUPPORTED_NSTRETCHNGPU; /// Reserved display info flag #2 - internal bool MANNER_SUPPORTED_RESERVED2; + public bool MANNER_SUPPORTED_RESERVED2; /// Reserved display info flag #3 - internal bool MANNER_SUPPORTED_RESERVED3; + public bool MANNER_SUPPORTED_RESERVED3; /// Indicates the display supports single desktop - internal bool MANNER_SUPPORTED_SINGLE; + public bool MANNER_SUPPORTED_SINGLE; /// Indicates the display supports overriding the mode timing - internal bool MODETIMING_OVERRIDESSUPPORTED; + public bool MODETIMING_OVERRIDESSUPPORTED; /// Indicates the display supports multi-vpu - internal bool MULTIVPU_SUPPORTED; + public bool MULTIVPU_SUPPORTED; /// Indicates the display is non-local to this machine - internal bool NONLOCAL; + public bool NONLOCAL; /// Indicates the display is a projector - internal bool SHOWTYPE_PROJECTOR; + public bool SHOWTYPE_PROJECTOR; } /// ADLDisplayConfig Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLDisplayConfig + public struct ADLDisplayConfig { /// Size of this data structure - internal long Size; + public long Size; /// HDTV Connector Type - internal long ConnectorType; + public long ConnectorType; /// HDTV Capabilities themselves - internal long DeviceData; + public long DeviceData; /// Overridden HDTV capabilities - internal long OverriddedDeviceData; + public long OverriddedDeviceData; /// Reserved for future use - internal long Reserved; + public long Reserved; } /// ADLDisplayMap Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLDisplayMap + public struct ADLDisplayMap { /// The current display map index. It is the OS desktop index. For example, if the OS index 1 is showing clone mode, the display map will be 1. - internal int DisplayMapIndex; + public int DisplayMapIndex; /// The Display Mode for the current map. - internal ADLMode DisplayMode; + public ADLMode DisplayMode; /// The number of display targets belongs to this map - internal int NumDisplayTarget; + public int NumDisplayTarget; /// The first target array index in the Target array - internal int FirstDisplayTargetArrayIndex; + public int FirstDisplayTargetArrayIndex; /// The bit mask identifies the number of bits DisplayMap is currently using. It is the sum of all the bit definitions defined in ADL_DISPLAY_DISPLAYMAP_MANNER_xxx. - internal int DisplayMapMask; + public int DisplayMapMask; /// The bit mask identifies the display status. The detailed definition is in ADL_DISPLAY_DISPLAYMAP_MANNER_xxx. - internal int DisplayMapValue; + public int DisplayMapValue; } /// ADLDisplayMapArray Array [StructLayout(LayoutKind.Sequential)] - internal struct ADLDisplayMapArray + public struct ADLDisplayMapArray { /// ADLAdapterInfo Array [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)ADL.ADL_MAX_DISPLAYS)] - internal ADLDisplayMap[] ADLDisplayMap; + public ADLDisplayMap[] ADLDisplayMap; } /// ADLAdapterCaps Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLAdapterCapsX2 + public struct ADLAdapterCapsX2 { /// AdapterID for this adapter - internal int AdapterID; + public int AdapterID; /// Number of controllers for this adapter. - internal int NumControllers; + public int NumControllers; /// Number of displays for this adapter. - internal int NumDisplays; + public int NumDisplays; /// Number of overlays for this adapter. - internal int NumOverlays; + public int NumOverlays; /// Number of GLSyncConnectors. - internal int NumOfGLSyncConnectors; + public int NumOfGLSyncConnectors; /// The bit mask identifies the adapter caps. - internal int CapsMask; + public int CapsMask; /// The bit identifies the adapter caps define_adapter_caps. - internal int CapsValue; + public int CapsValue; /// Number of Connectors for this adapter. - internal int NumConnectors; + public int NumConnectors; } #endregion ADLDisplayInfo @@ -739,156 +739,156 @@ namespace ATI.ADL /// ADLSLSGrid Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLSLSGrid + public struct ADLSLSGrid { /// The Adapter index - internal int AdapterIndex; + public int AdapterIndex; /// The grid index - internal int SLSGridIndex; + public int SLSGridIndex; /// The grid row. - internal int SLSGridRow; + public int SLSGridRow; /// The grid column - internal int SLSGridColumn; + public int SLSGridColumn; /// The grid bit mask identifies the number of bits DisplayMap is currently using. - internal int SLSGridMask; + public int SLSGridMask; /// The grid bit value identifies the display status. - internal int SLSGridValue; + public int SLSGridValue; } /// ADLSLSMap Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLSLSMap + public struct ADLSLSMap { /// The Adapter Index - internal int AdapterIndex; + public int AdapterIndex; /// The current display map index. It is the OS Desktop index. - internal int SLSMapIndex; + public int SLSMapIndex; /// The current grid - internal ADLSLSGrid Grid; + public ADLSLSGrid Grid; /// OS Surface Index - internal int SurfaceMapIndex; + public int SurfaceMapIndex; /// Screen orientation. E.g., 0, 90, 180, 270. - internal int Orientation; + public int Orientation; /// The number of display targets belongs to this map. - internal int NumSLSTarget; + public int NumSLSTarget; /// The first target array index in the Target array. - internal int FirstSLSTargetArrayIndex; + public int FirstSLSTargetArrayIndex; /// The number of native modes belongs to this map. - internal int NumNativeMode; + public int NumNativeMode; /// The first native mode array index in the native mode array. - internal int FirstNativeModeArrayIndex; + public int FirstNativeModeArrayIndex; /// The number of bezel modes belongs to this map. - internal int NumBezelMode; + public int NumBezelMode; /// The first bezel mode array index in the native mode array - internal int FirstBezelModeArrayIndex; + public int FirstBezelModeArrayIndex; /// The number of bezel offsets belongs to this map. - internal int NumBezelOffset; + public int NumBezelOffset; /// The first bezel offset array index in the native mode array - internal int FirstBezelOffsetArrayIndex; + public int FirstBezelOffsetArrayIndex; /// Bitmask identifies display map status - internal int SLSMapMask; + public int SLSMapMask; /// Bitmask identifies display map status - internal int SLSMapValue; + public int SLSMapValue; } /// ADLSLSTarget Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLSLSTarget + public struct ADLSLSTarget { /// The Adapter Index - internal int AdapterIndex; + public int AdapterIndex; /// The SLS map index. - internal int SLSMapIndex; + public int SLSMapIndex; /// The target ID. - internal ADLDisplayTarget DisplayTarget; + public ADLDisplayTarget DisplayTarget; /// Target postion X in SLS grid - internal int SLSGridPositionX; + public int SLSGridPositionX; /// Target postion Y in SLS grid - internal int SLSGridPositionY; + public int SLSGridPositionY; /// The view size width, height and rotation angle per SLS Target. - internal ADLMode ViewSize; + public ADLMode ViewSize; /// The bit mask identifies the bits in iSLSTargetValue are currently used. - internal int SLSTargetMask; + public int SLSTargetMask; /// The bit mask identifies status info. - internal int SLSTargetValue; + public int SLSTargetValue; } /// ADLSLSTarget Array [StructLayout(LayoutKind.Sequential)] - internal struct ADLSLSTargetArray + public struct ADLSLSTargetArray { /// ADLAdapterInfo Array [MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)ADL.ADL_MAX_ADAPTERS)] - internal ADLSLSTarget[] ADLSLSTarget; + public ADLSLSTarget[] ADLSLSTarget; } /// ADLSLSMode Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLSLSMode + public struct ADLSLSMode { /// The Adapter Index - internal int AdapterIndex; + public int AdapterIndex; /// The current display map index. It is the OS Desktop index. - internal int SLSMapIndex; + public int SLSMapIndex; /// The mode index. - internal int SLSModeIndex; + public int SLSModeIndex; /// The target ID. - internal ADLMode DisplayMode; + public ADLMode DisplayMode; /// The bit mask identifies the number of bits Mode is currently using. - internal int SLSNativeModeMask; + public int SLSNativeModeMask; /// The bit mask identifies the display status. - internal int SLSNativeModeValue; + public int SLSNativeModeValue; } /// ADLBezelTransientMode Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLBezelTransientMode + public struct ADLBezelTransientMode { /// The Adapter Index - internal int AdapterIndex; + public int AdapterIndex; /// SLS Map Index. - internal int SLSMapIndex; + public int SLSMapIndex; /// SLS Mode Index. - internal int SLSModeIndex; + public int SLSModeIndex; /// The target ID. - internal ADLMode DisplayMode; + public ADLMode DisplayMode; /// The number of bezel offsets belongs to this map. - internal int NumBezelOffset; + public int NumBezelOffset; /// The first bezel offset array index in the native mode array. - internal int FirstBezelOffsetArrayIndex; + public int FirstBezelOffsetArrayIndex; /// The bit mask identifies the bits this structure is currently using. - internal int SLSBezelTransientModeMask; + public int SLSBezelTransientModeMask; /// The bit mask identifies the display status. - internal int SLSBezelTransientModeValue; + public int SLSBezelTransientModeValue; } /// ADLSLSOffset Structure [StructLayout(LayoutKind.Sequential)] - internal struct ADLSLSOffset + public struct ADLSLSOffset { /// The Adapter Index - internal int AdapterIndex; + public int AdapterIndex; /// The current display map index. It is the OS Desktop index. - internal int SLSMapIndex; + public int SLSMapIndex; /// The target ID. - internal ADLDisplayID DisplayID; + public ADLDisplayID DisplayID; /// SLS Bezel Mode Index. - internal int BezelModeIndex; + public int BezelModeIndex; /// SLS Bezel Offset X. - internal int BezelOffsetX; + public int BezelOffsetX; /// SLS Bezel Offset Y. - internal int BezelOffsetY; + public int BezelOffsetY; /// SLS Display Width. - internal int DisplayWidth; + public int DisplayWidth; /// SLS Display Height. - internal int DisplayHeight; + public int DisplayHeight; /// The bit mask identifies the number of bits Offset is currently using. - internal int BezelOffsetMask; + public int BezelOffsetMask; /// The bit mask identifies the display status. - internal int BezelOffsetValue; + public int BezelOffsetValue; } #endregion ADLSLS @@ -897,264 +897,264 @@ namespace ATI.ADL #region ADL Class /// ADL Class - internal static class ADL + public static class ADL { #region Internal Constant /// Selects all adapters instead of aparticular single adapter - internal const int ADL_ADAPTER_INDEX_ALL = -1; + public const int ADL_ADAPTER_INDEX_ALL = -1; /// Define the maximum char - internal const int ADL_MAX_CHAR = 4096; + public const int ADL_MAX_CHAR = 4096; /// Define the maximum path - internal const int ADL_MAX_PATH = 256; + public const int ADL_MAX_PATH = 256; /// Define the maximum adapters - internal const int ADL_MAX_ADAPTERS = 250; + public const int ADL_MAX_ADAPTERS = 250; /// Define the maximum displays - internal const int ADL_MAX_DISPLAYS = 150; + public const int ADL_MAX_DISPLAYS = 150; /// Define the maximum device name length - internal const int ADL_MAX_DEVICENAME = 32; + public const int ADL_MAX_DEVICENAME = 32; /// Define the maximum EDID Data length - internal const int ADL_MAX_EDIDDATA_SIZE = 256; // number of UCHAR + public const int ADL_MAX_EDIDDATA_SIZE = 256; // number of UCHAR /// Define the maximum display names - internal const int ADL_MAX_DISPLAY_NAME = 256; + public const int ADL_MAX_DISPLAY_NAME = 256; // Result Codes /// ADL function completed successfully. - internal const int ADL_OK = 0; + public const int ADL_OK = 0; /// Generic Error.Most likely one or more of the Escape calls to the driver failed! - internal const int ADL_ERR = -1; + public const int ADL_ERR = -1; /// Call can't be made due to disabled adapter. - internal const int ADL_ERR_DISABLED_ADAPTER = -10; + public const int ADL_ERR_DISABLED_ADAPTER = -10; /// Invalid ADL index passed. - internal const int ADL_ERR_INVALID_ADL_IDX = -5; + public const int ADL_ERR_INVALID_ADL_IDX = -5; /// Invalid Callback. - internal const int ADL_ERR_INVALID_CALLBACK = -11; + public const int ADL_ERR_INVALID_CALLBACK = -11; /// Invalid controller index passed. - internal const int ADL_ERR_INVALID_CONTROLLER_IDX = -6; + public const int ADL_ERR_INVALID_CONTROLLER_IDX = -6; /// Invalid display index passed. - internal const int ADL_ERR_INVALID_DISPLAY_IDX = -7; + public const int ADL_ERR_INVALID_DISPLAY_IDX = -7; /// One of the parameter passed is invalid. - internal const int ADL_ERR_INVALID_PARAM = -3; + public const int ADL_ERR_INVALID_PARAM = -3; /// One of the parameter size is invalid. - internal const int ADL_ERR_INVALID_PARAM_SIZE = -4; + public const int ADL_ERR_INVALID_PARAM_SIZE = -4; /// There's no Linux XDisplay in Linux Console environment. - internal const int ADL_ERR_NO_XDISPLAY = -21; + public const int ADL_ERR_NO_XDISPLAY = -21; /// ADL not initialized. - internal const int ADL_ERR_NOT_INIT = -2; + public const int ADL_ERR_NOT_INIT = -2; /// Function not supported by the driver. - internal const int ADL_ERR_NOT_SUPPORTED = -8; + public const int ADL_ERR_NOT_SUPPORTED = -8; /// Null Pointer error. - internal const int ADL_ERR_NULL_POINTER = -9; + public const int ADL_ERR_NULL_POINTER = -9; /// Display Resource conflict. - internal const int ADL_ERR_RESOURCE_CONFLICT = -12; + public const int ADL_ERR_RESOURCE_CONFLICT = -12; /// Err Set incomplete - internal const int ADL_ERR_SET_INCOMPLETE = -20; + public const int ADL_ERR_SET_INCOMPLETE = -20; /// All OK but need mode change. - internal const int ADL_OK_MODE_CHANGE = 2; + public const int ADL_OK_MODE_CHANGE = 2; /// All OK, but need restart. - internal const int ADL_OK_RESTART = 3; + public const int ADL_OK_RESTART = 3; /// All OK, but need to wait - internal const int ADL_OK_WAIT = 4; + public const int ADL_OK_WAIT = 4; /// All OK, but with warning. - internal const int ADL_OK_WARNING = 1; + public const int ADL_OK_WARNING = 1; /// Define the driver ok - internal const int ADL_DRIVER_OK = 0; + public const int ADL_DRIVER_OK = 0; /// Maximum number of GL-Sync ports on the GL-Sync module - internal const int ADL_MAX_GLSYNC_PORTS = 8; + public const int ADL_MAX_GLSYNC_PORTS = 8; /// Maximum number of GL-Sync ports on the GL-Sync module - internal const int ADL_MAX_GLSYNC_PORT_LEDS = 8; + public const int ADL_MAX_GLSYNC_PORT_LEDS = 8; /// Maximum number of ADLModes for the adapter - internal const int ADL_MAX_NUM_DISPLAYMODES = 1024; + public const int ADL_MAX_NUM_DISPLAYMODES = 1024; /// Define true - internal const int ADL_TRUE = 1; + public const int ADL_TRUE = 1; /// Maximum number of ADLModes for the adapter - internal const int ADL_FALSE = 0; + public const int ADL_FALSE = 0; /// Indicates the active dongle, all types - internal const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE = 12; + public const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE = 12; /// Indicates the Active dongle DP->DVI(double link) connection type is valid. - internal const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE_DP_DVI_DL = 6; + public const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE_DP_DVI_DL = 6; /// Indicates the Active dongle DP->DVI(single link) connection type is valid. - internal const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE_DP_DVI_SL = 5; + public const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE_DP_DVI_SL = 5; /// Indicates the Active dongle DP->HDMI connection type is valid. - internal const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE_DP_HDMI = 7; + public const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE_DP_HDMI = 7; /// Indicates the Active dongle DP->VGA connection type is valid. - internal const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE_DP_VGA = 8; + public const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE_DP_VGA = 8; /// Indicates the DISPLAY PORT connection type is valid. - internal const int ADL_CONNECTION_TYPE_DISPLAY_PORT = 4; + public const int ADL_CONNECTION_TYPE_DISPLAY_PORT = 4; /// Indicates the DVI_I connection type is valid. - internal const int ADL_CONNECTION_TYPE_DVI = 1; + public const int ADL_CONNECTION_TYPE_DVI = 1; /// Indicates the DVI_SL connection type is valid. - internal const int ADL_CONNECTION_TYPE_DVI_SL = 2; + public const int ADL_CONNECTION_TYPE_DVI_SL = 2; /// Indicates the HDMI connection type is valid. - internal const int ADL_CONNECTION_TYPE_HDMI = 3; + public const int ADL_CONNECTION_TYPE_HDMI = 3; /// Indicates the MST type is valid. - internal const int ADL_CONNECTION_TYPE_MST = 11; + public const int ADL_CONNECTION_TYPE_MST = 11; /// Indicates the Active dongle DP->VGA connection type is valid. - internal const int ADL_CONNECTION_TYPE_PASSIVE_DONGLE_DP_DVI = 10; + public const int ADL_CONNECTION_TYPE_PASSIVE_DONGLE_DP_DVI = 10; /// Indicates the Passive dongle DP->HDMI connection type is valid. - internal const int ADL_CONNECTION_TYPE_PASSIVE_DONGLE_DP_HDMI = 9; + public const int ADL_CONNECTION_TYPE_PASSIVE_DONGLE_DP_HDMI = 9; /// Indicates the VGA connection type is valid. - internal const int ADL_CONNECTION_TYPE_VGA = 0; + public const int ADL_CONNECTION_TYPE_VGA = 0; /// Indicates the Virtual Connection Type. - internal const int ADL_CONNECTION_TYPE_VIRTUAL = 13; + public const int ADL_CONNECTION_TYPE_VIRTUAL = 13; /// Indicates Active Dongle-JP Connector type. - internal const int ADL_CONNECTOR_TYPE_ATICVDONGLE_JP = 5; + public const int ADL_CONNECTOR_TYPE_ATICVDONGLE_JP = 5; /// Indicates Active Dongle-NA Connector type. - internal const int ADL_CONNECTOR_TYPE_ATICVDONGLE_NA = 4; + public const int ADL_CONNECTOR_TYPE_ATICVDONGLE_NA = 4; /// Indicates Active Dongle-NONI2C Connector type. - internal const int ADL_CONNECTOR_TYPE_ATICVDONGLE_NONI2C = 6; + public const int ADL_CONNECTOR_TYPE_ATICVDONGLE_NONI2C = 6; /// Indicates Active Dongle-NONI2C-D Connector type. - internal const int ADL_CONNECTOR_TYPE_ATICVDONGLE_NONI2C_D = 7; + public const int ADL_CONNECTOR_TYPE_ATICVDONGLE_NONI2C_D = 7; /// Indicates Display port Connector type. - internal const int ADL_CONNECTOR_TYPE_DISPLAYPORT = 10; + public const int ADL_CONNECTOR_TYPE_DISPLAYPORT = 10; /// Indicates DVI-D Connector type. - internal const int ADL_CONNECTOR_TYPE_DVI_D = 2; + public const int ADL_CONNECTOR_TYPE_DVI_D = 2; /// Indicates DVI-I Connector type. - internal const int ADL_CONNECTOR_TYPE_DVI_I = 3; + public const int ADL_CONNECTOR_TYPE_DVI_I = 3; /// Indicates EDP Connector type. - internal const int ADL_CONNECTOR_TYPE_EDP = 11; + public const int ADL_CONNECTOR_TYPE_EDP = 11; /// Indicates HDMI-Type A Connector type. - internal const int ADL_CONNECTOR_TYPE_HDMI_TYPE_A = 8; + public const int ADL_CONNECTOR_TYPE_HDMI_TYPE_A = 8; /// Indicates HDMI-Type B Connector type. - internal const int ADL_CONNECTOR_TYPE_HDMI_TYPE_B = 9; + public const int ADL_CONNECTOR_TYPE_HDMI_TYPE_B = 9; /// Indicates MiniDP Connector type. - internal const int ADL_CONNECTOR_TYPE_MINI_DISPLAYPORT = 12; + public const int ADL_CONNECTOR_TYPE_MINI_DISPLAYPORT = 12; /// Indicates Unknown Connector type. - internal const int ADL_CONNECTOR_TYPE_UNKNOWN = 0; + public const int ADL_CONNECTOR_TYPE_UNKNOWN = 0; /// Indicates USB type C Connector type. - internal const int ADL_CONNECTOR_TYPE_USB_TYPE_C = 14; + public const int ADL_CONNECTOR_TYPE_USB_TYPE_C = 14; /// Indicates VGA Connector type. - internal const int ADL_CONNECTOR_TYPE_VGA = 1; + public const int ADL_CONNECTOR_TYPE_VGA = 1; /// Indicates Virtual Connector type. - internal const int ADL_CONNECTOR_TYPE_VIRTUAL = 13; + public const int ADL_CONNECTOR_TYPE_VIRTUAL = 13; // ADL Display Connector Types /// Indicates Unknown Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_UNKNOWN = 0; + public const int ADL_DISPLAY_CONTYPE_UNKNOWN = 0; /// Indicates VGA Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_VGA = 1; + public const int ADL_DISPLAY_CONTYPE_VGA = 1; /// Indicates DVI-D Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_DVI_D = 2; + public const int ADL_DISPLAY_CONTYPE_DVI_D = 2; /// Indicates DVI-I Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_DVI_I = 3; + public const int ADL_DISPLAY_CONTYPE_DVI_I = 3; /// Indicates ATICV NTSC Dongle Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_ATICVDONGLE_NTSC = 4; + public const int ADL_DISPLAY_CONTYPE_ATICVDONGLE_NTSC = 4; /// Indicates ATICV Japanese Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_ATICVDONGLE_JPN = 5; + public const int ADL_DISPLAY_CONTYPE_ATICVDONGLE_JPN = 5; /// Indicates ATICV non-I2C Japanese Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_ATICVDONGLE_NONI2C_JPN = 6; + public const int ADL_DISPLAY_CONTYPE_ATICVDONGLE_NONI2C_JPN = 6; /// Indicates ATICV non-I2C NTSC Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_ATICVDONGLE_NONI2C_NTSC = 7; + public const int ADL_DISPLAY_CONTYPE_ATICVDONGLE_NONI2C_NTSC = 7; /// Indicates Proprietary Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_PROPRIETARY = 8; + public const int ADL_DISPLAY_CONTYPE_PROPRIETARY = 8; /// Indicates HDMI Type A Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_HDMI_TYPE_A = 10; + public const int ADL_DISPLAY_CONTYPE_HDMI_TYPE_A = 10; /// Indicates HDMI Type B Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_HDMI_TYPE_B = 11; + public const int ADL_DISPLAY_CONTYPE_HDMI_TYPE_B = 11; /// Indicates S-Video Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_SVIDEO = 12; + public const int ADL_DISPLAY_CONTYPE_SVIDEO = 12; /// Indicates Composite Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_COMPOSITE = 13; + public const int ADL_DISPLAY_CONTYPE_COMPOSITE = 13; /// Indicates RCA 3-component Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_RCA_3COMPONENT = 14; + public const int ADL_DISPLAY_CONTYPE_RCA_3COMPONENT = 14; /// Indicates DisplayPort Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_DISPLAYPORT = 15; + public const int ADL_DISPLAY_CONTYPE_DISPLAYPORT = 15; /// Indicates EDP Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_EDP = 16; + public const int ADL_DISPLAY_CONTYPE_EDP = 16; /// Indicates Wireless Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_WIRELESSDISPLAY = 17; + public const int ADL_DISPLAY_CONTYPE_WIRELESSDISPLAY = 17; /// Indicates USB Type-C Display Connector type. - internal const int ADL_DISPLAY_CONTYPE_USB_TYPE_C = 18; + public const int ADL_DISPLAY_CONTYPE_USB_TYPE_C = 18; // Display Info Constants /// Indicates the display is connected . - internal const int ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED = 0x00000001; + public const int ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED = 0x00000001; /// Indicates the display is mapped within OS - internal const int ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED = 0x00000002; + public const int ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED = 0x00000002; /// Indicates the display can be forced - internal const int ADL_DISPLAY_DISPLAYINFO_FORCIBLESUPPORTED = 0x00000008; + public const int ADL_DISPLAY_DISPLAYINFO_FORCIBLESUPPORTED = 0x00000008; /// Indicates the display supports genlock - internal const int ADL_DISPLAY_DISPLAYINFO_GENLOCKSUPPORTED = 0x00000010; + public const int ADL_DISPLAY_DISPLAYINFO_GENLOCKSUPPORTED = 0x00000010; /// Indicates the display is an LDA display. - internal const int ADL_DISPLAY_DISPLAYINFO_LDA_DISPLAY = 0x00000040; + public const int ADL_DISPLAY_DISPLAYINFO_LDA_DISPLAY = 0x00000040; /// Indicates the display supports 2x Horizontal stretch - internal const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_2HSTRETCH = 0x00000800; + public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_2HSTRETCH = 0x00000800; /// Indicates the display supports 2x Vertical stretch - internal const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_2VSTRETCH = 0x00000400; + public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_2VSTRETCH = 0x00000400; /// Indicates the display supports cloned desktops - internal const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_CLONE = 0x00000200; + public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_CLONE = 0x00000200; /// Indicates the display supports extended desktops - internal const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_EXTENDED = 0x00001000; + public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_EXTENDED = 0x00001000; /// Indicates the display supports N Stretched on 1 GPU - internal const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_NSTRETCH1GPU = 0x00010000; + public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_NSTRETCH1GPU = 0x00010000; /// Indicates the display supports N Stretched on N GPUs - internal const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_NSTRETCHNGPU = 0x00020000; + public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_NSTRETCHNGPU = 0x00020000; /// Reserved display info flag #2 - internal const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_RESERVED2 = 0x00040000; + public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_RESERVED2 = 0x00040000; /// Reserved display info flag #3 - internal const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_RESERVED3 = 0x00080000; + public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_RESERVED3 = 0x00080000; /// Indicates the display supports single desktop - internal const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_SINGLE = 0x00000100; + public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_SINGLE = 0x00000100; /// Indicates the display supports overriding the mode timing - internal const int ADL_DISPLAY_DISPLAYINFO_MODETIMING_OVERRIDESSUPPORTED = 0x00000080; + public const int ADL_DISPLAY_DISPLAYINFO_MODETIMING_OVERRIDESSUPPORTED = 0x00000080; /// Indicates the display supports multi-vpu - internal const int ADL_DISPLAY_DISPLAYINFO_MULTIVPU_SUPPORTED = 0x00000020; + public const int ADL_DISPLAY_DISPLAYINFO_MULTIVPU_SUPPORTED = 0x00000020; /// Indicates the display is non-local to this machine - internal const int ADL_DISPLAY_DISPLAYINFO_NONLOCAL = 0x00000004; + public const int ADL_DISPLAY_DISPLAYINFO_NONLOCAL = 0x00000004; /// Indicates the display is a projector - internal const int ADL_DISPLAY_DISPLAYINFO_SHOWTYPE_PROJECTOR = 0x00100000; + public const int ADL_DISPLAY_DISPLAYINFO_SHOWTYPE_PROJECTOR = 0x00100000; // Display Mode Constants /// Indicates the display is in interlaced mode - internal const int ADL_DISPLAY_MODE_INTERLACED_FLAG = 2; + public const int ADL_DISPLAY_MODE_INTERLACED_FLAG = 2; /// Indicates the display is in progressive mode - internal const int ADL_DISPLAY_MODE_PROGRESSIVE_FLAG = 0; + public const int ADL_DISPLAY_MODE_PROGRESSIVE_FLAG = 0; /// Indicates the display colour format is 565 - internal const int ADL_DISPLAY_MODE_COLOURFORMAT_565 = 0x00000001; + public const int ADL_DISPLAY_MODE_COLOURFORMAT_565 = 0x00000001; /// Indicates the display colour format is 8888 - internal const int ADL_DISPLAY_MODE_COLOURFORMAT_8888 = 0x00000002; + public const int ADL_DISPLAY_MODE_COLOURFORMAT_8888 = 0x00000002; /// Indicates the display orientation is normal position - internal const int ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_000 = 0x00000004; + public const int ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_000 = 0x00000004; /// Indicates the display is in the 90 degree position - internal const int ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_090 = 0x00000008; + public const int ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_090 = 0x00000008; /// Indicates the display in the 180 degree position - internal const int ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_180 = 0x00000010; + public const int ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_180 = 0x00000010; /// Indicates the display is in the 270 degree position - internal const int ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_270 = 0x00000020; + public const int ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_270 = 0x00000020; /// Indicates the display refresh rate is exact - internal const int ADL_DISPLAY_MODE_REFRESHRATE_ONLY = 0x00000080; + public const int ADL_DISPLAY_MODE_REFRESHRATE_ONLY = 0x00000080; /// Indicates the display refresh rate is rounded - internal const int ADL_DISPLAY_MODE_REFRESHRATE_ROUNDED = 0x00000040; + public const int ADL_DISPLAY_MODE_REFRESHRATE_ROUNDED = 0x00000040; // DDCInfoX2 DDCInfo Flag values /// Indicates the display is a projector - internal const int ADL_DISPLAYDDCINFOEX_FLAG_PROJECTORDEVICE = (1 << 0); + public const int ADL_DISPLAYDDCINFOEX_FLAG_PROJECTORDEVICE = (1 << 0); /// Indicates the display is a projector - internal const int ADL_DISPLAYDDCINFOEX_FLAG_EDIDEXTENSION = (1 << 1); + public const int ADL_DISPLAYDDCINFOEX_FLAG_EDIDEXTENSION = (1 << 1); /// Indicates the display is a projector - internal const int ADL_DISPLAYDDCINFOEX_FLAG_DIGITALDEVICE = (1 << 2); + public const int ADL_DISPLAYDDCINFOEX_FLAG_DIGITALDEVICE = (1 << 2); /// Indicates the display is a projector - internal const int ADL_DISPLAYDDCINFOEX_FLAG_HDMIAUDIODEVICE = (1 << 3); + public const int ADL_DISPLAYDDCINFOEX_FLAG_HDMIAUDIODEVICE = (1 << 3); /// Indicates the display is a projector - internal const int ADL_DISPLAYDDCINFOEX_FLAG_SUPPORTS_AI = (1 << 4); + public const int ADL_DISPLAYDDCINFOEX_FLAG_SUPPORTS_AI = (1 << 4); /// Indicates the display is a projector - internal const int ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC601 = (1 << 5); + public const int ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC601 = (1 << 5); /// Indicates the display is a projector - internal const int ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC709 = (1 << 6); + public const int ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC709 = (1 << 6); /// HDR10/CEA861.3 HDR supported - internal const int ADL_HDR_CEA861_3 = 0x0001; + public const int ADL_HDR_CEA861_3 = 0x0001; /// DolbyVision HDR supported - internal const int ADL_HDR_DOLBYVISION = 0x0002; + public const int ADL_HDR_DOLBYVISION = 0x0002; /// FreeSync HDR supported. - internal const int ADL_HDR_FREESYNC_HDR = 0x0004; + public const int ADL_HDR_FREESYNC_HDR = 0x0004; #endregion Internal Constant #region Internal Enums - internal enum ADLConnectionType + public enum ADLConnectionType { VGA = 0, DVI = 1, @@ -1172,7 +1172,7 @@ namespace ATI.ADL Virtual = 13 } - internal enum ADLDisplayConnectionType + public enum ADLDisplayConnectionType { Unknown = 0, VGA = 1, @@ -1195,7 +1195,7 @@ namespace ATI.ADL USBTypeC = 18 } - internal enum ADLDisplayModeFlag + public enum ADLDisplayModeFlag { ColourFormat565 = 1, ColourFormat8888 = 2, @@ -1206,7 +1206,7 @@ namespace ATI.ADL ExactRefreshRate = 80, RoundedRefreshRate = 40 } - internal enum ADLDisplayModeInterlacing + public enum ADLDisplayModeInterlacing { Progressive = 0, Interlaced = 2 @@ -1219,121 +1219,121 @@ namespace ATI.ADL { #region Internal Constant /// Atiadlxx_FileName - internal const string Atiadlxx_FileName = "atiadlxx.dll"; + public const string Atiadlxx_FileName = "atiadlxx.dll"; /// Kernel32_FileName - internal const string Kernel32_FileName = "kernel32.dll"; + public const string Kernel32_FileName = "kernel32.dll"; #endregion Internal Constant #region DLLImport [DllImport(Kernel32_FileName)] - internal static extern HMODULE GetModuleHandle (string moduleName); + public static extern HMODULE GetModuleHandle (string moduleName); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_Main_Control_Create(ADL_Main_Memory_Alloc callback, int enumConnectedAdapters, out IntPtr contextHandle); + public static extern int ADL2_Main_Control_Create(ADL_Main_Memory_Alloc callback, int enumConnectedAdapters, out IntPtr contextHandle); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_Main_Control_Destroy(IntPtr contextHandle); + public static extern int ADL2_Main_Control_Destroy(IntPtr contextHandle); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_Adapter_NumberOfAdapters_Get(IntPtr contextHandle, ref int numAdapters); + public static extern int ADL2_Adapter_NumberOfAdapters_Get(IntPtr contextHandle, ref int numAdapters); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_Adapter_Active_Get(IntPtr ADLContextHandle, int adapterIndex, ref int status); + public static extern int ADL2_Adapter_Active_Get(IntPtr ADLContextHandle, int adapterIndex, ref int status); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_AdapterX2_Caps(IntPtr ADLContextHandle, int adapterIndex, out ADLAdapterCapsX2 adapterCapabilities); + public static extern int ADL2_AdapterX2_Caps(IntPtr ADLContextHandle, int adapterIndex, out ADLAdapterCapsX2 adapterCapabilities); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_Adapter_AdapterInfo_Get(IntPtr ADLContextHandle, int inputSize, out IntPtr AdapterInfoArray); + public static extern int ADL2_Adapter_AdapterInfo_Get(IntPtr ADLContextHandle, int inputSize, out IntPtr AdapterInfoArray); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_Adapter_AdapterInfoX2_Get(IntPtr ADLContextHandle, out IntPtr AdapterInfoArray); + public static extern int ADL2_Adapter_AdapterInfoX2_Get(IntPtr ADLContextHandle, out IntPtr AdapterInfoArray); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_Adapter_AdapterInfoX3_Get(IntPtr ADLContextHandle, int adapterIndex, out int numAdapters, out IntPtr AdapterInfoArray); + public static extern int ADL2_Adapter_AdapterInfoX3_Get(IntPtr ADLContextHandle, int adapterIndex, out int numAdapters, out IntPtr AdapterInfoArray); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_Adapter_AdapterInfoX4_Get(IntPtr ADLContextHandle, int adapterIndex, out int numAdapters, out IntPtr AdapterInfoX2Array); + public static extern int ADL2_Adapter_AdapterInfoX4_Get(IntPtr ADLContextHandle, int adapterIndex, out int numAdapters, out IntPtr AdapterInfoX2Array); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_Display_DDCInfo2_Get(IntPtr contextHandle, int adapterIndex, int displayIndex, out ADLDDCInfo2 DDCInfo); + public static extern int ADL2_Display_DDCInfo2_Get(IntPtr contextHandle, int adapterIndex, int displayIndex, out ADLDDCInfo2 DDCInfo); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_Display_DisplayInfo_Get(IntPtr ADLContextHandle, int adapterIndex, ref int numDisplays, out IntPtr displayInfoArray, int forceDetect); + public static extern int ADL2_Display_DisplayInfo_Get(IntPtr ADLContextHandle, int adapterIndex, ref int numDisplays, out IntPtr displayInfoArray, int forceDetect); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_Display_DeviceConfig_Get(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, out ADLDisplayConfig displayConfig); + public static extern int ADL2_Display_DeviceConfig_Get(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, out ADLDisplayConfig displayConfig); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_Display_HDRState_Get(IntPtr ADLContextHandle, int adapterIndex, ADLDisplayID displayID, out int support, out int enable); + public static extern int ADL2_Display_HDRState_Get(IntPtr ADLContextHandle, int adapterIndex, ADLDisplayID displayID, out int support, out int enable); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL2_Display_Modes_Get(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, out int numModes, out IntPtr modes); + public static extern int ADL2_Display_Modes_Get(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, out int numModes, out IntPtr modes); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Main_Control_Create (ADL_Main_Memory_Alloc callback, int enumConnectedAdapters); + public static extern int ADL_Main_Control_Create (ADL_Main_Memory_Alloc callback, int enumConnectedAdapters); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Main_Control_Destroy (); + public static extern int ADL_Main_Control_Destroy (); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Main_Control_IsFunctionValid (HMODULE module, string procName); + public static extern int ADL_Main_Control_IsFunctionValid (HMODULE module, string procName); [DllImport(Atiadlxx_FileName)] - internal static extern FARPROC ADL_Main_Control_GetProcAddress (HMODULE module, string procName); + public static extern FARPROC ADL_Main_Control_GetProcAddress (HMODULE module, string procName); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Adapter_NumberOfAdapters_Get (ref int numAdapters); + public static extern int ADL_Adapter_NumberOfAdapters_Get (ref int numAdapters); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Adapter_AdapterInfo_Get (out IntPtr info, int inputSize); + public static extern int ADL_Adapter_AdapterInfo_Get (out IntPtr info, int inputSize); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Adapter_Active_Get(int adapterIndex, ref int status); + public static extern int ADL_Adapter_Active_Get(int adapterIndex, ref int status); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Adapter_ID_Get(int adapterIndex, ref int adapterId); + public static extern int ADL_Adapter_ID_Get(int adapterIndex, ref int adapterId); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_AdapterX2_Caps(int adapterIndex, out ADLAdapterCapsX2 adapterCapabilities); + public static extern int ADL_AdapterX2_Caps(int adapterIndex, out ADLAdapterCapsX2 adapterCapabilities); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Display_DisplayInfo_Get(int adapterIndex, ref int numDisplays, out IntPtr displayInfoArray, int forceDetect); + public static extern int ADL_Display_DisplayInfo_Get(int adapterIndex, ref int numDisplays, out IntPtr displayInfoArray, int forceDetect); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Display_DeviceConfig_Get(int adapterIndex, int displayIndex, out ADLDisplayConfig displayConfig); + public static extern int ADL_Display_DeviceConfig_Get(int adapterIndex, int displayIndex, out ADLDisplayConfig displayConfig); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Display_EdidData_Get(int adapterIndex, int displayIndex, ref ADLDisplayEDIDData EDIDData); + public static extern int ADL_Display_EdidData_Get(int adapterIndex, int displayIndex, ref ADLDisplayEDIDData EDIDData); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Display_DisplayMapConfig_Get(int adapterIndex, out int numDisplayMap, out IntPtr displayMap, out int numDisplayTarget, out IntPtr displayTarget, int options); + public static extern int ADL_Display_DisplayMapConfig_Get(int adapterIndex, out int numDisplayMap, out IntPtr displayMap, out int numDisplayTarget, out IntPtr displayTarget, int options); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Display_DisplayMapConfig_PossibleAddAndRemove(int adapterIndex, int numDisplayMap, ADLDisplayMap displayMap, int numDisplayTarget, ADLDisplayTarget displayTarget, out int numPossibleAddTarget, out IntPtr possibleAddTarget, out int numPossibleRemoveTarget, out IntPtr possibleRemoveTarget); + public static extern int ADL_Display_DisplayMapConfig_PossibleAddAndRemove(int adapterIndex, int numDisplayMap, ADLDisplayMap displayMap, int numDisplayTarget, ADLDisplayTarget displayTarget, out int numPossibleAddTarget, out IntPtr possibleAddTarget, out int numPossibleRemoveTarget, out IntPtr possibleRemoveTarget); [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Display_SLSMapConfig_Get(int adapterIndex, int SLSMapIndex, ref ADLSLSMap SLSMap, ref int NumSLSTarget, out IntPtr SLSTargetArray, ref int lpNumNativeMode, out IntPtr NativeMode, ref int NumBezelMode, out IntPtr BezelMode, ref int NumTransientMode, out IntPtr TransientMode, ref int NumSLSOffset, out IntPtr SLSOffset, int iOption); + public static extern int ADL_Display_SLSMapConfig_Get(int adapterIndex, int SLSMapIndex, ref ADLSLSMap SLSMap, ref int NumSLSTarget, out IntPtr SLSTargetArray, ref int lpNumNativeMode, out IntPtr NativeMode, ref int NumBezelMode, out IntPtr BezelMode, ref int NumTransientMode, out IntPtr TransientMode, ref int NumSLSOffset, out IntPtr SLSOffset, int iOption); // This is used to set the SLS Grid we want from the SLSMap by selecting the one we want and supplying that as an index. [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Display_SLSMapConfig_SetState(int AdapterIndex, int SLSMapIndex, int State); + public static extern int ADL_Display_SLSMapConfig_SetState(int AdapterIndex, int SLSMapIndex, int State); // Function to get the current supported SLS grid patterns (MxN) for a GPU. // This function gets a list of supported SLS grids for a specified input adapter based on display devices currently connected to the GPU. [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Display_SLSGrid_Caps(int adapterIndex, ref int NumSLSGrid, out IntPtr SLSGrid, int option); + public static extern int ADL_Display_SLSGrid_Caps(int adapterIndex, ref int NumSLSGrid, out IntPtr SLSGrid, int option); // Function to get the active SLS map index list for a given GPU. // This function retrieves a list of active SLS map indexes for a specified input GPU. [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Display_SLSMapIndexList_Get(int adapterIndex, ref int numSLSMapIndexList, out IntPtr SLSMapIndexList, int options); + public static extern int ADL_Display_SLSMapIndexList_Get(int adapterIndex, ref int numSLSMapIndexList, out IntPtr SLSMapIndexList, int options); // Function to get the active SLS map index list for a given GPU. // This function retrieves a list of active SLS map indexes for a specified input GPU. [DllImport(Atiadlxx_FileName)] - internal static extern int ADL_Display_SLSMapIndex_Get(int adapterIndex, int ADLNumDisplayTarget, ref ADLDisplayTarget displayTarget, ref int SLSMapIndex); + public static extern int ADL_Display_SLSMapIndex_Get(int adapterIndex, int ADLNumDisplayTarget, ref ADLDisplayTarget displayTarget, ref int SLSMapIndex); #endregion DLLImport } @@ -1384,7 +1384,7 @@ namespace ATI.ADL /// Check the import function to see it exists or not /// function name /// return true, if function exists - internal static bool IsFunctionValid (string functionName) + public static bool IsFunctionValid (string functionName) { bool result = false; if (System.IntPtr.Zero != ADLCheckLibrary_.ADLLibrary) @@ -1402,7 +1402,7 @@ namespace ATI.ADL /// Get the unmanaged function pointer /// function name /// return function pointer, if function exists - internal static FARPROC GetProcAddress (string functionName) + public static FARPROC GetProcAddress (string functionName) { FARPROC result = System.IntPtr.Zero; if (System.IntPtr.Zero != ADLCheckLibrary_.ADLLibrary) @@ -1419,7 +1419,7 @@ namespace ATI.ADL #region ADL_Main_Memory_Alloc /// Build in memory allocation function - internal static ADL_Main_Memory_Alloc ADL_Main_Memory_Alloc = ADL_Main_Memory_Alloc_; + public static ADL_Main_Memory_Alloc ADL_Main_Memory_Alloc = ADL_Main_Memory_Alloc_; /// Build in memory allocation function /// input size /// return the memory buffer @@ -1433,7 +1433,7 @@ namespace ATI.ADL #region ADL_Main_Memory_Free /// Build in memory free function /// input buffer - internal static void ADL_Main_Memory_Free (IntPtr buffer) + public static void ADL_Main_Memory_Free (IntPtr buffer) { if (IntPtr.Zero != buffer) { @@ -1444,7 +1444,7 @@ namespace ATI.ADL #region ADL2_Main_Control_Create /// ADL2_Main_Control_Create Delegates - internal static ADL2_Main_Control_Create ADL2_Main_Control_Create + public static ADL2_Main_Control_Create ADL2_Main_Control_Create { get { @@ -1467,7 +1467,7 @@ namespace ATI.ADL #region ADL2_Main_Control_Destroy /// ADL2_Main_Control_Destroy Delegates - internal static ADL2_Main_Control_Destroy ADL2_Main_Control_Destroy + public static ADL2_Main_Control_Destroy ADL2_Main_Control_Destroy { get { @@ -1490,7 +1490,7 @@ namespace ATI.ADL #region ADL2_Adapter_NumberOfAdapters_Get /// ADL2_Adapter_NumberOfAdapters_Get Delegates - internal static ADL2_Adapter_NumberOfAdapters_Get ADL2_Adapter_NumberOfAdapters_Get + public static ADL2_Adapter_NumberOfAdapters_Get ADL2_Adapter_NumberOfAdapters_Get { get { @@ -1513,7 +1513,7 @@ namespace ATI.ADL #region ADL2_Adapter_Active_Get /// ADL2_Adapter_Active_Get Delegates - internal static ADL2_Adapter_Active_Get ADL2_Adapter_Active_Get + public static ADL2_Adapter_Active_Get ADL2_Adapter_Active_Get { get { @@ -1536,7 +1536,7 @@ namespace ATI.ADL #region ADL2_AdapterX2_Caps /// ADL2_AdapterX2_Caps Delegates - internal static ADL2_AdapterX2_Caps ADL2_AdapterX2_Caps + public static ADL2_AdapterX2_Caps ADL2_AdapterX2_Caps { get { @@ -1560,7 +1560,7 @@ namespace ATI.ADL #region ADL2_Adapter_AdapterInfo_Get /// ADL2_Adapter_AdapterInfo_Get Delegates - internal static ADL2_Adapter_AdapterInfo_Get ADL2_Adapter_AdapterInfo_Get + public static ADL2_Adapter_AdapterInfo_Get ADL2_Adapter_AdapterInfo_Get { get { @@ -1583,7 +1583,7 @@ namespace ATI.ADL #region ADL2_Adapter_AdapterInfoX2_Get /// ADL2_Adapter_AdapterInfoX2_Get Delegates - internal static ADL2_Adapter_AdapterInfoX2_Get ADL2_Adapter_AdapterInfoX2_Get + public static ADL2_Adapter_AdapterInfoX2_Get ADL2_Adapter_AdapterInfoX2_Get { get { @@ -1606,7 +1606,7 @@ namespace ATI.ADL #region ADL2_Adapter_AdapterInfoX3_Get /// ADL2_Adapter_AdapterInfoX3_Get Delegates - internal static ADL2_Adapter_AdapterInfoX3_Get ADL2_Adapter_AdapterInfoX3_Get + public static ADL2_Adapter_AdapterInfoX3_Get ADL2_Adapter_AdapterInfoX3_Get { get { @@ -1629,7 +1629,7 @@ namespace ATI.ADL #region ADL2_Adapter_AdapterInfoX4_Get /// ADL2_Adapter_AdapterInfoX4_Get Delegates - internal static ADL2_Adapter_AdapterInfoX4_Get ADL2_Adapter_AdapterInfoX4_Get + public static ADL2_Adapter_AdapterInfoX4_Get ADL2_Adapter_AdapterInfoX4_Get { get { @@ -1652,7 +1652,7 @@ namespace ATI.ADL #region ADL2_Display_DDCInfo2_Get /// ADL2_Display_DDCInfo2_Get Delegates - internal static ADL2_Display_DDCInfo2_Get ADL2_Display_DDCInfo2_Get + public static ADL2_Display_DDCInfo2_Get ADL2_Display_DDCInfo2_Get { get { @@ -1675,7 +1675,7 @@ namespace ATI.ADL #region ADL2_Display_DisplayInfo_Get /// ADL2_Display_DisplayInfo_Get Delegates - internal static ADL2_Display_DisplayInfo_Get ADL2_Display_DisplayInfo_Get + public static ADL2_Display_DisplayInfo_Get ADL2_Display_DisplayInfo_Get { get { @@ -1698,7 +1698,7 @@ namespace ATI.ADL #region ADL2_Display_DeviceConfig_Get /// ADL2_Display_DeviceConfig_Get Delegates - internal static ADL2_Display_DeviceConfig_Get ADL2_Display_DeviceConfig_Get + public static ADL2_Display_DeviceConfig_Get ADL2_Display_DeviceConfig_Get { get { @@ -1721,7 +1721,7 @@ namespace ATI.ADL #region ADL2_Display_HDRState_Get /// ADL2_Display_HDRState_Get Delegates - internal static ADL2_Display_HDRState_Get ADL2_Display_HDRState_Get + public static ADL2_Display_HDRState_Get ADL2_Display_HDRState_Get { get { @@ -1744,7 +1744,7 @@ namespace ATI.ADL #region ADL2_Display_Modes_Get /// ADL2_Display_Modes_Get Delegates - internal static ADL2_Display_Modes_Get ADL2_Display_Modes_Get + public static ADL2_Display_Modes_Get ADL2_Display_Modes_Get { get { @@ -1770,7 +1770,7 @@ namespace ATI.ADL #region ADL_Main_Control_Create /// ADL_Main_Control_Create Delegates - internal static ADL_Main_Control_Create ADL_Main_Control_Create + public static ADL_Main_Control_Create ADL_Main_Control_Create { get { @@ -1793,7 +1793,7 @@ namespace ATI.ADL #region ADL_Main_Control_Destroy /// ADL_Main_Control_Destroy Delegates - internal static ADL_Main_Control_Destroy ADL_Main_Control_Destroy + public static ADL_Main_Control_Destroy ADL_Main_Control_Destroy { get { @@ -1816,7 +1816,7 @@ namespace ATI.ADL #region ADL_Adapter_NumberOfAdapters_Get /// ADL_Adapter_NumberOfAdapters_Get Delegates - internal static ADL_Adapter_NumberOfAdapters_Get ADL_Adapter_NumberOfAdapters_Get + public static ADL_Adapter_NumberOfAdapters_Get ADL_Adapter_NumberOfAdapters_Get { get { @@ -1840,7 +1840,7 @@ namespace ATI.ADL #region ADL_Adapter_ID_Get /// ADL_Adapter_Active_Get Delegates - internal static ADL_Adapter_ID_Get ADL_Adapter_ID_Get + public static ADL_Adapter_ID_Get ADL_Adapter_ID_Get { get { @@ -1863,7 +1863,7 @@ namespace ATI.ADL #region ADL_AdapterX2_Caps /// ADL_AdapterX2_Caps Delegates - internal static ADL_AdapterX2_Caps ADL_AdapterX2_Caps + public static ADL_AdapterX2_Caps ADL_AdapterX2_Caps { get { @@ -1886,7 +1886,7 @@ namespace ATI.ADL #region ADL_Adapter_AdapterInfo_Get /// ADL_Adapter_AdapterInfo_Get Delegates - internal static ADL_Adapter_AdapterInfo_Get ADL_Adapter_AdapterInfo_Get + public static ADL_Adapter_AdapterInfo_Get ADL_Adapter_AdapterInfo_Get { get { @@ -1909,7 +1909,7 @@ namespace ATI.ADL #region ADL_Adapter_Active_Get /// ADL_Adapter_Active_Get Delegates - internal static ADL_Adapter_Active_Get ADL_Adapter_Active_Get + public static ADL_Adapter_Active_Get ADL_Adapter_Active_Get { get { @@ -1932,7 +1932,7 @@ namespace ATI.ADL #region ADL_Display_DeviceConfig_Get /// ADL_Display_DeviceConfig_Get Delegates - internal static ADL_Display_DeviceConfig_Get ADL_Display_DeviceConfig_Get + public static ADL_Display_DeviceConfig_Get ADL_Display_DeviceConfig_Get { get { @@ -1955,7 +1955,7 @@ namespace ATI.ADL #region ADL_Display_DisplayMapConfig_Get /// ADL_Display_DisplayMapConfig_Get Delegates - internal static ADL_Display_DisplayMapConfig_Get ADL_Display_DisplayMapConfig_Get + public static ADL_Display_DisplayMapConfig_Get ADL_Display_DisplayMapConfig_Get { get { @@ -1978,7 +1978,7 @@ namespace ATI.ADL #region ADL_Display_DisplayMapConfig_PossibleAddAndRemove /// ADL_Display_DisplayMapConfig_PossibleAddAndRemove Delegates - internal static ADL_Display_DisplayMapConfig_PossibleAddAndRemove ADL_Display_DisplayMapConfig_PossibleAddAndRemove + public static ADL_Display_DisplayMapConfig_PossibleAddAndRemove ADL_Display_DisplayMapConfig_PossibleAddAndRemove { get { @@ -2002,7 +2002,7 @@ namespace ATI.ADL #region ADL_Display_EdidData_Get /// ADL_Display_EdidData_Get Delegates - internal static ADL_Display_EdidData_Get ADL_Display_EdidData_Get + public static ADL_Display_EdidData_Get ADL_Display_EdidData_Get { get { @@ -2026,7 +2026,7 @@ namespace ATI.ADL #region ADL_Display_DisplayInfo_Get /// ADL_Display_DisplayInfo_Get Delegates - internal static ADL_Display_DisplayInfo_Get ADL_Display_DisplayInfo_Get + public static ADL_Display_DisplayInfo_Get ADL_Display_DisplayInfo_Get { get { @@ -2050,7 +2050,7 @@ namespace ATI.ADL #region ADL_Display_SLSMapConfig_Get /// ADL_Display_SLSMapConfig_Get Delegates - internal static ADL_Display_SLSMapConfig_Get ADL_Display_SLSMapConfig_Get + public static ADL_Display_SLSMapConfig_Get ADL_Display_SLSMapConfig_Get { get { @@ -2076,7 +2076,7 @@ namespace ATI.ADL #region ADL Helper Functions - internal static ConvertedDDCInfoFlag ConvertDDCInfoFlag(int DDCInfoValue) + public static ConvertedDDCInfoFlag ConvertDDCInfoFlag(int DDCInfoValue) { ConvertedDDCInfoFlag expandedDDCInfoValue = new ConvertedDDCInfoFlag(); @@ -2106,7 +2106,7 @@ namespace ATI.ADL } - internal static ConvertedSupportedHDR ConvertSupportedHDR(int supportedHDR) + public static ConvertedSupportedHDR ConvertSupportedHDR(int supportedHDR) { ConvertedSupportedHDR expandedSupportedHDR = new ConvertedSupportedHDR(); @@ -2124,7 +2124,7 @@ namespace ATI.ADL } - internal static ConvertedDisplayInfoValue ConvertDisplayInfoValue(int displayInfoValue) + public static ConvertedDisplayInfoValue ConvertDisplayInfoValue(int displayInfoValue) { ConvertedDisplayInfoValue expandedDisplayInfoValue = new ConvertedDisplayInfoValue(); @@ -2187,7 +2187,7 @@ namespace ATI.ADL } - internal static ConvertedDisplayModeFlags ConvertDisplayModeFlags(int displayModeFlag) + public static ConvertedDisplayModeFlags ConvertDisplayModeFlags(int displayModeFlag) { ConvertedDisplayModeFlags expandedDisplayModeFlags = new ConvertedDisplayModeFlags(); @@ -2221,7 +2221,7 @@ namespace ATI.ADL } - internal static string ConvertADLReturnValueIntoWords(int adlReturnValue) + public static string ConvertADLReturnValueIntoWords(int adlReturnValue) { if (adlReturnValue == ADL.ADL_OK) return "Success. Function worked as intended."; diff --git a/DisplayMagicianShared/AMD/AMDLibrary.cs b/DisplayMagicianShared/AMD/AMDLibrary.cs index 93d2776..cf81111 100644 --- a/DisplayMagicianShared/AMD/AMDLibrary.cs +++ b/DisplayMagicianShared/AMD/AMDLibrary.cs @@ -21,29 +21,7 @@ namespace DisplayMagicianShared.AMD // Instantiate a SafeHandle instance. private SafeHandle _safeHandle = new SafeFileHandle(IntPtr.Zero, true); private IntPtr _adlContextHandle = IntPtr.Zero; - - // Struct to be used as the AMD Profile - public struct AMDProfile - { - public List Adapters; - } - - // Struct to store the Display - public struct AMDAdapter - { - internal ADLAdapterInfoX2 AdapterInfoX2; - internal List Displays; - } - - // Struct to store the Display - public struct AMDDisplay - { - internal string DisplayName; - internal string DisplayConnector; - internal List DisplayModes; - } - - + static AMDLibrary() { } public AMDLibrary() { @@ -1199,8 +1177,10 @@ namespace DisplayMagicianShared.AMD displayToCreate.DisplayModes = new List(); displayToCreate.DisplayName = oneDisplayInfo.DisplayName; displayToCreate.DisplayConnector = displayConnector.ToString("G"); + displayToCreate.IsEyefinity = false; + displayToCreate.HDRSupported = false; + displayToCreate.HDREnabled = false; - SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: ### Display Info for Display #{oneDisplayInfo.DisplayID.DisplayLogicalIndex} on Adapter #{oneAdapter.AdapterIndex} ###"); SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: Display Connector = {displayConnector.ToString("G")}"); @@ -1282,8 +1262,6 @@ namespace DisplayMagicianShared.AMD ADLDDCInfo2 displayDDCInfo2 = new ADLDDCInfo2(); displayDDCInfo2.Size = Marshal.SizeOf(displayDDCInfo2); - // Create a stringbuilder buffer that EDID can be loaded into - //displayEDIDData.EDIDData = new StringBuilder(256); if (ADL.ADL2_Display_DDCInfo2_Get != null) { @@ -1357,6 +1335,8 @@ namespace DisplayMagicianShared.AMD adapterToCreate.Displays.Add(displayToCreate); } + + // Add the HDR information to the profile display storage int HDRSupported = 0; int HDREnabled = 0; if (ADL.ADL2_Display_HDRState_Get != null) @@ -1375,114 +1355,8 @@ namespace DisplayMagicianShared.AMD } } - - // Create an array of all the important display info we need to record - List displayInfoIdentifierSection = new List(); - displayInfoIdentifierSection.Add("AMD"); - try - { - displayInfoIdentifierSection.Add(oneAdapter.VendorID.ToString()); - } - catch (Exception ex) - { - SharedLogger.logger.Warn(ex, $"AMDLibrary/GetActiveprofile: Exception getting AMD Vendor ID from video card. Substituting with a # instead"); - displayInfoIdentifierSection.Add("#"); - } - - try - { - displayInfoIdentifierSection.Add(oneAdapter.AdapterName); - } - catch (Exception ex) - { - SharedLogger.logger.Warn(ex, $"AMDLibrary/GetActiveprofile: Exception getting AMD Adapter Name from video card. Substituting with a # instead"); - displayInfoIdentifierSection.Add("#"); - } - - try - { - displayInfoIdentifierSection.Add(oneAdapter.VendorID.ToString()); - } - catch (Exception ex) - { - SharedLogger.logger.Warn(ex, $"AMDLibrary/GetActiveprofile: Exception getting AMD VendorID from video card. Substituting with a # instead"); - displayInfoIdentifierSection.Add("1002"); - } - - try - { - displayInfoIdentifierSection.Add(AdapterCapabilities.AdapterID.ToString()); - } - catch (Exception ex) - { - SharedLogger.logger.Warn(ex, $"AMDLibrary/GetActiveprofile: Exception getting AMD AdapterID from video card. Substituting with a # instead"); - displayInfoIdentifierSection.Add("#"); - } - - try - { - displayInfoIdentifierSection.Add(displayConnector.ToString("G")); - } - catch (Exception ex) - { - SharedLogger.logger.Warn(ex, $"AMDLibrary/GetActiveprofile: Exception getting AMD Display Connector from video card to display. Substituting with a # instead"); - displayInfoIdentifierSection.Add("#"); - } - - try - { - displayInfoIdentifierSection.Add(oneDisplayInfo.DisplayName); - } - catch (Exception ex) - { - SharedLogger.logger.Warn(ex, $"AMDLibrary/GetActiveprofile: Exception getting Display Name from display connected to AMD video card. Substituting with a # instead"); - displayInfoIdentifierSection.Add("#"); - } - - try - { - displayInfoIdentifierSection.Add(displayDDCInfo2.ManufacturerID.ToString()); - } - catch (Exception ex) - { - SharedLogger.logger.Warn(ex, $"AMDLibrary/GetActiveprofile: Exception getting Manufacturer ID from display connected to AMD video card. Substituting with a # instead"); - displayInfoIdentifierSection.Add("#"); - } - - try - { - displayInfoIdentifierSection.Add(displayDDCInfo2.ProductID.ToString()); - } - catch (Exception ex) - { - SharedLogger.logger.Warn(ex, $"AMDLibrary/GetActiveprofile: Exception getting Product ID from display connected to AMD video card. Substituting with a # instead"); - displayInfoIdentifierSection.Add("#"); - } - - try - { - displayInfoIdentifierSection.Add(displayDDCInfo2.SerialID.ToString()); - } - catch (Exception ex) - { - SharedLogger.logger.Warn(ex, $"AMDLibrary/GetActiveprofile: Exception getting Serial ID from display connected to AMD video card. Substituting with a # instead"); - displayInfoIdentifierSection.Add("#"); - } - - // Create a display identifier out of it - string displayIdentifier = String.Join("|", displayInfoIdentifierSection); - - // Check first to see if there is already an existing display identifier the same! - // This appears to be a bug with the AMD driver, or with the install on my test machine - // Either way, it is potentially going to happen in the wild, so I will filter it out if it does - if (displayIdentifiers.Contains(displayIdentifier)) - { - SharedLogger.logger.Trace($"AMDLibrary/GetActiveprofile: Your AMD driver reported the following Display Identifier multiple times, so ignoring it as we already have it: {displayIdentifier}"); - continue; - } - - - SharedLogger.logger.Debug($"ProfileRepository/GetActiveprofile: DisplayIdentifier: {displayIdentifier}"); + displayToCreate.HDREnabled = HDREnabled == 0 ? false : true; + displayToCreate.HDRSupported = HDRSupported == 0 ? false : true; } } catch (Exception ex) @@ -1543,37 +1417,6 @@ namespace DisplayMagicianShared.AMD return true; } - /*public List GenerateScreenPositions(AMDProfile profileToCreate) - { - List screens = new List(); - - - if (profileToCreate.Adapters.Count > 0) - { - foreach (var adapter in profileToCreate.Adapters) - { - foreach (var display in adapter.Displays) - { - foreach (var mode in display.DisplayModes) - { - ScreenPosition screen = new ScreenPosition(); - screen.Colour = Color.Red; // represents AMD - screen.Name = mode.DisplayID.ToString(); - screen.ScreenX = mode.XPos; - screen.ScreenY = mode.YPos; - screen.ScreenWidth = mode.XRes; - screen.ScreenHeight = mode.YRes; - screen.IsSpanned = false; - //screen.Features = mode.ModeValue; - - screens.Add(screen); - } - } - } - } - - - return screens; - }*/ + } } diff --git a/DisplayMagicianShared/AMD/AMDProfileItem.cs b/DisplayMagicianShared/AMD/AMDProfileItem.cs index 8556d21..ef8fb27 100644 --- a/DisplayMagicianShared/AMD/AMDProfileItem.cs +++ b/DisplayMagicianShared/AMD/AMDProfileItem.cs @@ -9,10 +9,42 @@ using System.Drawing; using System.Drawing.Imaging; using System.Text.RegularExpressions; using IWshRuntimeLibrary; +using ATI.ADL; //using WK.Libraries.HotkeyListenerNS; namespace DisplayMagicianShared.AMD { + + // Struct to be used as the AMD Profile + [JsonObject(MemberSerialization.Fields)] + public struct AMDProfile + { + public List Adapters; + } + + // Struct to store the Display + [JsonObject(MemberSerialization.Fields)] + public struct AMDAdapter + { + [JsonProperty] + internal ADLAdapterInfoX2 AdapterInfoX2; + internal List Displays; + } + + // Struct to store the Display + [JsonObject(MemberSerialization.Fields)] + public struct AMDDisplay + { + internal string DisplayName; + internal string DisplayConnector; + [JsonRequired] + internal List DisplayModes; + internal bool HDRSupported; + internal bool HDREnabled; + internal bool IsEyefinity; + + } + public class AMDProfileItem : ProfileItem, IComparable { private static List _allSavedProfiles = new List(); @@ -20,7 +52,7 @@ namespace DisplayMagicianShared.AMD private Bitmap _profileBitmap, _profileShortcutBitmap; private List _profileDisplayIdentifiers = new List(); private List _screens; - private AMDLibrary.AMDProfile _profileData = new AMDLibrary.AMDProfile(); + private AMDProfile _profileData = new AMDProfile(); private static readonly string uuidV4Regex = @"(?im)^[{(]?[0-9A-F]{8}[-]?(?:[0-9A-F]{4}[-]?){3}[0-9A-F]{12}[)}]?$"; private string _uuid = ""; @@ -70,7 +102,8 @@ namespace DisplayMagicianShared.AMD //public Topology.Path[] Paths { get; set; } = new Topology.Path[0]; - public AMDLibrary.AMDProfile ProfileData + [JsonRequired] + public AMDProfile ProfileData { get { @@ -78,11 +111,7 @@ namespace DisplayMagicianShared.AMD } set { - _profileData = new AMDLibrary.AMDProfile(); - - // We also update the screenPositions too so that - // the icons will work and graphics will display - //GetScreenPositions(); + _profileData = value; } } @@ -115,14 +144,23 @@ namespace DisplayMagicianShared.AMD } return _screens; } + set + { + _screens = value; + } } - [JsonConverter(typeof(CustomBitmapConverter))] - public new Bitmap ProfileBitmap + + //[JsonConverter(typeof(CustomBitmapConverter))] + [JsonIgnore] + public override Bitmap ProfileBitmap { get { + /*if (!ProfileRepository.ProfilesLoaded) + return null;*/ + if (_profileBitmap != null) return _profileBitmap; else @@ -138,6 +176,28 @@ namespace DisplayMagicianShared.AMD } + + //[JsonConverter(typeof(CustomBitmapConverter))] + [JsonIgnore] + public override Bitmap ProfileTightestBitmap + { + get + { + if (_profileShortcutBitmap != null) + return _profileShortcutBitmap; + else + { + _profileShortcutBitmap = this.ProfileIcon.ToTightestBitmap(); + return _profileShortcutBitmap; + } + } + set + { + _profileShortcutBitmap = value; + } + + } + #endregion public override bool IsValid() @@ -211,6 +271,13 @@ namespace DisplayMagicianShared.AMD } } + public virtual bool PerformPostLoadingTasks() + { + // First thing we do is to set up the Screens + _screens = GetScreenPositions(); + + return true; + } public override List GetScreenPositions() { @@ -228,21 +295,51 @@ namespace DisplayMagicianShared.AMD { ScreenPosition screen = new ScreenPosition(); screen.Library = "AMD"; - //screen.Colour = Color.FromArgb(200, 237, 28, 36); // represents AMD Red - screen.Colour = Color.FromArgb(255, 195, 195, 195); // represents normal screen colour screen.Name = display.DisplayName; screen.DisplayConnector = display.DisplayConnector; screen.ScreenX = mode.XPos; screen.ScreenY = mode.YPos; screen.ScreenWidth = mode.XRes; screen.ScreenHeight = mode.YRes; - screen.IsSpanned = false; - + + // HDR information + if (display.HDRSupported) + { + screen.HDRSupported = true; + if (display.HDREnabled) + { + screen.HDREnabled = true; + } + else + { + screen.HDREnabled = false; + } + + } + else + { + screen.HDRSupported = false; + screen.HDREnabled = false; + } + // Spanned screen options + if (display.IsEyefinity) + { + screen.IsSpanned = true; + screen.Colour = Color.FromArgb(200, 237, 28, 36); // represents AMD Red + screen.SpannedName = "AMD Eyefinity"; + } + else + { + screen.IsSpanned = false; + screen.Colour = Color.FromArgb(255, 195, 195, 195); // represents normal screen colour + } + + // Figure out features //ATI.ADL.ADL.ConvertDisplayModeFlags(mode.ModeValue); - + //screen.Features = mode.ModeValue; _screens.Add(screen); diff --git a/DisplayMagicianShared/ProfileIcon.cs b/DisplayMagicianShared/ProfileIcon.cs index 20ef713..7ebe042 100644 --- a/DisplayMagicianShared/ProfileIcon.cs +++ b/DisplayMagicianShared/ProfileIcon.cs @@ -311,7 +311,7 @@ namespace DisplayMagicianShared } }*/ - private void DrawScreen(Graphics g, ScreenPosition screen) + /*private void DrawScreen(Graphics g, ScreenPosition screen) { //var res = NormalizeResolution(screen); Rectangle rect = new Rectangle(screen.ScreenX, screen.ScreenY, screen.ScreenWidth, screen.ScreenHeight); @@ -407,6 +407,115 @@ namespace DisplayMagicianShared { DrawScreen(g, screen); } + }*/ + + private void DrawView(Graphics g, float width, float height) + { + // Figure out the sizes we need based on the total size of the screens + var viewSize = ProfileIcon.CalculateViewSize(_profile.Screens, PaddingX, PaddingY); + var standPadding = height * 0.005f; + height -= standPadding * 8; + var factor = Math.Min((width - 2 * standPadding - 1) / viewSize.Width, + (height - 2 * standPadding - 1) / viewSize.Height); + g.ScaleTransform(factor, factor); + + // Make space for the stand + var xOffset = ((width - 1) / factor - viewSize.Width) / 2f; + var yOffset = ((height - 1) / factor - viewSize.Height) / 2f; + g.TranslateTransform(-viewSize.X + xOffset, -viewSize.Y + yOffset); + + // How wide the Bezel is on the screen graphics + int screenBezel = 60; + int screenWordBuffer = 30; + + // Draw the stand + if (standPadding * 6 >= 1) + { + using (var boundRect = RoundedRect(viewSize, 2 * standPadding / factor)) + { + g.FillPath(new SolidBrush(Color.FromArgb(200, 255, 255, 255)), boundRect); + g.DrawPath(new Pen(Color.FromArgb(170, 50, 50, 50), standPadding / factor), boundRect); + } + + using ( + var boundRect = + RoundedRect( + new RectangleF(viewSize.Width * 0.375f + viewSize.X, + viewSize.Height + standPadding / factor, + viewSize.Width / 4, standPadding * 7 / factor), 2 * standPadding / factor)) + { + g.FillPath(new SolidBrush(Color.FromArgb(250, 50, 50, 50)), boundRect); + g.DrawPath(new Pen(Color.FromArgb(50, 255, 255, 255), 2 / factor), boundRect); + } + } + else + { + g.FillRectangle(new SolidBrush(Color.FromArgb(200, 255, 255, 255)), viewSize); + g.DrawRectangle(new Pen(Color.FromArgb(170, 50, 50, 50), standPadding / factor), viewSize.X, viewSize.Y, + viewSize.Width, viewSize.Height); + } + + // Now go through and draw the screens + foreach (ScreenPosition screen in _profile.Screens) + { + + Color screenBgColour; + Color lightTextColour = Color.White; + Color darkTextColour = Color.Black; + + // draw the screen + if (screen.IsSpanned) + { + //g.FillRectangle(new SolidBrush(Color.FromArgb(150, 106, 185, 0)), targetRect); + } + else + { + + // Draw the outline of the monitor + Rectangle outlineRect = new Rectangle(screen.ScreenX, screen.ScreenY, screen.ScreenWidth, screen.ScreenHeight); + g.FillRectangle(new SolidBrush(Color.FromArgb(255, 33, 33, 33)), outlineRect); + g.DrawRectangle(Pens.Black, outlineRect); + + // Draw the screen of the monitor + Rectangle screenRect = new Rectangle(screen.ScreenX + screenBezel, screen.ScreenY + screenBezel, screen.ScreenWidth - (screenBezel * 2), screen.ScreenHeight - (screenBezel * 2)); + if (screen.Colour != null) + { + screenBgColour = screen.Colour; + } + else + { + screenBgColour = Color.FromArgb(255, 155, 155, 155); + } + g.FillRectangle(new SolidBrush(screenBgColour), screenRect); + g.DrawRectangle(Pens.Black, screenRect); + + } + } + } + + + private Color pickTextColorBasedOnBgColour(Color bgColour, Color lightColour, Color darkColour) + { + if ((bgColour.R * 0.299 + bgColour.G * 0.587 + bgColour.B * 0.114) > 186) + { + return darkColour; + } + else + { + return lightColour; + } + } + + private Bitmap pickBitmapBasedOnBgColour(Color bgColour, Bitmap lightBitmap, Bitmap darkBitmap) + { + if ((bgColour.R * 0.299 + bgColour.G * 0.587 + bgColour.B * 0.114) > 186) + { + return darkBitmap; + } + else + { + return lightBitmap; + } } } } \ No newline at end of file diff --git a/DisplayMagicianShared/ProfileItem.cs b/DisplayMagicianShared/ProfileItem.cs index b7d90eb..4a10683 100644 --- a/DisplayMagicianShared/ProfileItem.cs +++ b/DisplayMagicianShared/ProfileItem.cs @@ -25,14 +25,17 @@ namespace DisplayMagicianShared public string Library; public bool IsPrimary; public Color Colour; + public string DisplayConnector; + internal bool HDRSupported; + internal bool HDREnabled; public List Features; // If the screen is AMD Eyefinity or NVIDIA Surround or similar, it has screens that are part of it - // These two fields indicate this. THe spanned screens are added to the SpannedScreens field + // These fields indicate this. THe spanned screens are added to the SpannedScreens field public bool IsSpanned; + public string SpannedName; public List SpannedScreens; public int SpannedColumns; public int SpannedRows; - public string DisplayConnector; } public struct SpannedScreenPosition @@ -178,7 +181,7 @@ namespace DisplayMagicianShared } } - public virtual string Driver { get; } = "Unknown"; + public virtual string Driver { get; } = "Unknown"; public Keys Hotkey { get @@ -195,7 +198,7 @@ namespace DisplayMagicianShared //public Topology.Path[] Paths { get; set; } = new Topology.Path[0]; - //public virtual object ProfileData { get; set; } + //public virtual ProfileData { get; set; } [JsonIgnore] public virtual ProfileIcon ProfileIcon @@ -217,7 +220,6 @@ namespace DisplayMagicianShared } - [JsonIgnore] public virtual List Screens { @@ -229,6 +231,10 @@ namespace DisplayMagicianShared } return _screens; } + set + { + _screens = value; + } } public string SavedProfileIconCacheFilename { get; set; } @@ -250,7 +256,8 @@ namespace DisplayMagicianShared } } - [JsonConverter(typeof(CustomBitmapConverter))] + //[JsonConverter(typeof(CustomBitmapConverter))] + [JsonIgnore] public virtual Bitmap ProfileBitmap { get @@ -270,8 +277,9 @@ namespace DisplayMagicianShared } - [JsonConverter(typeof(CustomBitmapConverter))] - public Bitmap ProfileTightestBitmap + //[JsonConverter(typeof(CustomBitmapConverter))] + [JsonIgnore] + public virtual Bitmap ProfileTightestBitmap { get { @@ -368,6 +376,11 @@ namespace DisplayMagicianShared return false; } + public virtual bool PerformPostLoadingTasks() + { + return false; + } + // The public override for the Object.Equals public override bool Equals(object obj) diff --git a/DisplayMagicianShared/ProfileRepository.cs b/DisplayMagicianShared/ProfileRepository.cs index c053f88..10602ac 100644 --- a/DisplayMagicianShared/ProfileRepository.cs +++ b/DisplayMagicianShared/ProfileRepository.cs @@ -32,6 +32,7 @@ namespace DisplayMagicianShared private static List _connectedDisplayIdentifiers = new List(); private static bool notifiedEDIDErrorToUser = false; private static AMDLibrary AMDLibrary; + //private static bool _isLoading = false; // Other constants that are useful public static string AppDataPath = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "DisplayMagician"); @@ -179,6 +180,17 @@ namespace DisplayMagicianShared } + public static bool ProfilesLoaded { + get + { + return _profilesLoaded; + } + set + { + _profilesLoaded = value; + } + } + #endregion #region Class Methods @@ -633,7 +645,6 @@ namespace DisplayMagicianShared SharedLogger.logger.Debug($"ProfileRepository/IsActiveProfile: Checking whether the profile {profile.Name} is the currently active profile."); - //if (profile.Paths.SequenceEqual(_currentProfile.Paths)) if (profile.Equals(_currentProfile)) { SharedLogger.logger.Debug($"ProfileRepository/IsActiveProfile: The profile {profile.Name} is the currently active profile."); @@ -679,7 +690,6 @@ namespace DisplayMagicianShared SharedLogger.logger.Error(ex, $"ProfileRepository/LoadProfiles: Tried to parse the JSON in the {_profileStorageJsonFileName} but the JsonConvert threw an exception."); } - ProfileItem myCurrentProfile = new NVIDIAProfileItem { Name = "Current Display Profile", @@ -690,9 +700,17 @@ namespace DisplayMagicianShared SharedLogger.logger.Debug($"ProfileRepository/LoadProfiles: Finding the current profile in the Profile Repository"); - // Lookup all the Profile Names in the Saved Profiles + // Go through all the profiles and set up the needed structures (such as the Screens list) + // and check if the current profile is used foreach (ProfileItem loadedProfile in _allProfiles) { + if (loadedProfile.Driver.Equals("AMD")) + { + AMDProfileItem amdLoadedProfile = (AMDProfileItem) loadedProfile; + amdLoadedProfile.PerformPostLoadingTasks(); + } + + if (ProfileRepository.IsActiveProfile(loadedProfile)) _currentProfile = loadedProfile;