#region Copyright
/*******************************************************************************
Copyright(c) 2008 - 2009 Advanced Micro Devices, Inc. All Rights Reserved.
Copyright (c) 2002 - 2006 ATI Technologies Inc. All Rights Reserved.
THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDED BUT NOT LIMITED TO
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
PARTICULAR PURPOSE.
File: ADL.cs
Purpose: Implements ADL interface
Description: Implements some of the methods defined in ADL interface.
********************************************************************************/
#endregion Copyright
#region Using
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.Threading;
using FARPROC = System.IntPtr;
using HMODULE = System.IntPtr;
#endregion Using
#region ATI.ADL
namespace ATI.ADL
{
#region Export Delegates
/// ADL Memory allocation function allows ADL to callback for memory allocation
/// input size
/// retrun ADL Error Code
public delegate IntPtr ADL_Main_Memory_Alloc (int size);
// ADL2 version of function delagates
/// ADL2 Create Function to create ADL Data
/// Call back functin pointer which is ised to allocate memory
/// If it is 1, then ADL will only retuen the physical exist adapters
/// Handle to ADL client context.
/// retrun ADL Error Code
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
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
public delegate int ADL2_Adapter_NumberOfAdapters_Get(IntPtr ADLContextHandle, ref int numAdapters);
/// ADL2 Function to save driver configuration so it survives a reboot
/// Handle to ADL client context.
/// Adapter Index to save state.
public delegate int ADL2_Flush_Driver_Data(IntPtr ADLContextHandle, int adapterIndex);
/// 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
/// Handle to ADL client context.
/// Adapter Index.
/// Status of the adapter. True: Active; False: Disabled
/// Non zero is successful
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 .
/// Handle to ADL client context.
/// Adapter Index.
/// The pointer to the ADLAdapterCaps structure storing the retrieved adapter capability information.
/// return ADL Error Code
public delegate int ADL2_AdapterX2_Caps(IntPtr ADLContextHandle, int adapterIndex, out ADLAdapterCapsX2 adapterCapabilities);
/// ADL2 Function to retrieve 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
/// the size of the GPU adapter struct
/// retrun ADL Error Code
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
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.
/// Handle to ADL client context.
/// The ADL index handle of the desired adapter or -1 if all adapters are desired
/// 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
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.
/// Handle to ADL client context.
/// The ADL index handle of the desired adapter or -1 if all adapters are desired
/// 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
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.
/// Adapter Index
/// Display Index
/// The ADLDDCInfo2 structure storing all DDC retrieved from the driver.
/// retrun ADL Error Code
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.
/// Adapter Index
/// return the total number of supported displays
/// return ADLDisplayInfo Array for supported displays' information
/// force detect or not
/// return ADL Error Code
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.
/// Adapter Index
/// Display Index
/// return ADLDisplayConfig with HDTV capability settings in it
/// return ADL Error Code
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.
/// Adapter Index
/// DisplayID for the desired display
/// 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
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.
/// Adapter Index
/// Display Index
/// return a pointer to the number of modes retrieved.
/// return a pointer to the array of retrieved ADLMode display modes.
/// return ADL Error Code
public delegate int ADL2_Display_Modes_Get(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, out int numModes, out IntPtr modes);
/// ADL2 function to set display mode information
/// Handle to ADL client context.
/// Adapter Index
/// Display Index
/// The number of modes to be set.
/// The pointer to the display mode information to be set. Refer to the ADLMode structure for more information.
/// return ADL Error Code
public delegate int ADL2_Display_Modes_Set(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, int numModes, ref ADLMode modes);
/// ADL2 function to retrieve the current display mode information
/// Handle to ADL client context.
/// Adapter Index
/// The pointer to the number of retrieved display maps
/// The pointer to the pointer to the display manner information. Refer to the ADLDisplayMap structure for more information.
/// The pointer to the display target sets retrieved.
/// The pointer to the pointer to the display target buffer. Refer to the ADLDisplayTarget structure for more information.
/// The function option. ADL_DISPLAY_DISPLAYMAP_OPTION_GPUINFO.
/// return ADL Error Code
public delegate int ADL2_Display_DisplayMapConfig_Get(IntPtr ADLContextHandle, int adapterIndex, out int numDisplayMap, out IntPtr displayMap, out int numDisplayTarget, out IntPtr displayTarget, int options);
/// ADL2 function to set the current display mode information
/// Handle to ADL client context.
/// Adapter Index
/// The number of display maps to set
/// The pointer to the display manner information. Refer to the ADLDisplayMap structure for more information.
/// The number of display targets to set
/// The pointer to the display target object. Refer to the ADLDisplayTarget structure for more information.
/// return ADL Error Code
public delegate int ADL2_Display_DisplayMapConfig_Set(IntPtr ADLContextHandle, int adapterIndex, int numDisplayMap, ref ADLDisplayMap displayMap, int numDisplayTarget, ref ADLDisplayTarget displayTarget);
/// ADL2 function to set the current display mode information
/// Handle to ADL client context.
/// Adapter Index
/// The number of possible maps to be validated.
/// The list of possible maps to be validated. Refer to the ADLPossibleMap structure for more information.
/// The pointer to the number of validated result list.
/// The pointer to the pointer to validation result list. Refer to the ADLPossibleMapResult structure for more information.
/// return ADL Error Code
public delegate int ADL2_Display_DisplayMapConfig_Validate(IntPtr ADLContextHandle, int adapterIndex, int numPossibleMap, ref ADLPossibleMap possibleMaps, out int numPossibleMapResult, ref IntPtr possibleMapResult);
// ADL version of function delegates
/// ADL Create Function to create ADL Data
/// 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
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
public delegate int ADL_Main_Control_Destroy ();
/// ADL Function to get the number of adapters
/// return number of adapters
/// retrun ADL Error Code
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
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
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
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
public delegate int ADL_Adapter_AdapterInfo_Get(out IntPtr adapterInfoArray, int inputSize);
/// Function to get the EDID data.
/// This function retrieves the EDID data for a specififed display.
/// Adapter Index
/// 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
public delegate int ADL_Display_EdidData_Get(int adapterIndex, int displayIndex, ref ADLDisplayEDIDData EDIDData);
/// Get display information based on adapter index
/// Adapter Index
/// return the total number of supported displays
/// return ADLDisplayInfo Array for supported displays' information
/// force detect or not
/// return ADL Error Code
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
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.
/// The ADL index handle of the desired adapter. A value of -1 returns all display configurations for the system across multiple GPUs.
/// Number of returned Display Maps
/// Array of ADLDisplayMap objects
/// Number of Display Targets
/// Array of ADLDisplayTarget objects
/// Options supplied
/// return ADL Error Code
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.
/// The ADL index handle of the desired adapter. Cannot be set to -1
/// Number of Display Map
/// Number of Display Map
/// Number of Display Map
/// Number of Display Map
/// Number of Display Map
/// Number of Display Map
/// Number of Display Map
/// Number of Display Map
/// return ADL Error Code
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
/// Specifies the SLS map index to be queried.
/// return ADLSLSMap Array for supported displays' information
/// return number of targets in the SLS mapo
/// return ADLSLSTarget Array
/// return the number of native modes
/// return ADLSLSMode Array that contains the native modes
/// return the number of bezel modes
/// return ADLSLSMode Array that contains the bezel modes
/// return the number of transient modes
/// return ADLSLSMode Array that contains the transient modes
/// return the number of SLS offsets
/// 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
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
#region Export Struct
#region ADLMode
/// ADLAdapterInfo Array
[StructLayout(LayoutKind.Sequential)]
public struct ADLMode
{
/// Adapter index.
public int AdapterIndex;
/// Display IDs.
public ADLDisplayID DisplayID;
/// Screen position X coordinate.
public int XPos;
/// Screen position Y coordinate.
public int YPos;
/// Screen resolution Width.
public int XRes;
/// Screen resolution Height.
public int YRes;
/// Screen Color Depth. E.g., 16, 32.
public int ColourDepth;
/// Screen refresh rate.
public float RefreshRate;
/// Screen orientation. E.g., 0, 90, 180, 270.
public int Orientation;
/// Vista mode flag indicating Progressive or Interlaced mode.
public int ModeFlag;
/// The bit mask identifying the number of bits this Mode is currently using.
public int ModeMask;
/// The bit mask identifying the display status.
public int ModeValue;
}
public struct ConvertedDisplayModeFlags
{
/// Indicates the display supports Colour Format 565.
public bool COLOURFORMAT_565;
/// Indicates the display supports Colour Format 8888.
public bool COLOURFORMAT_8888;
/// Indicates the display supports normal vertical orientation
public bool ORIENTATION_SUPPORTED_000;
/// Indicates the display supports 90 degree orientation
public bool ORIENTATION_SUPPORTED_090;
/// Indicates the display supports 180 degree orientation
public bool ORIENTATION_SUPPORTED_180;
/// Indicates the display supports 270 degree orientation
public bool ORIENTATION_SUPPORTED_270;
/// Indicates the display supports rounded refresh rates
public bool REFRESHRATE_ROUNDED;
/// Indicates the display supports exact refresh rates
public bool REFRESHRATE_ONLY;
}
#endregion ADLMode
#region ADLDisplayTarget
/// ADLDisplayTarget
[StructLayout(LayoutKind.Sequential)]
public struct ADLDisplayTarget
{
/// Display IDs.
public ADLDisplayID DisplayID;
/// The display map index identify this manner and the desktop surface.
public int DisplayMapIndex;
/// The bit mask identifies the number of bits DisplayTarget is currently using.
public int DisplayTargetMask;
/// The bit mask identifies the display status.
public int DisplayTargetValue;
}
/// ADLDisplayTargetArray Array
[StructLayout(LayoutKind.Sequential)]
public struct ADLDisplayTargetArray
{
/// ADLDisplayTarget Array
[MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)ADL.ADL_MAX_DISPLAYS)]
public ADLDisplayTarget[] ADLDisplayTarget;
}
#endregion ADLDisplayTarget
#region ADLAdapterInfo
/// ADLAdapterInfo Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLAdapterInfo
{
/// The size of the structure
int Size;
/// Adapter Index
public int AdapterIndex;
/// Adapter UDID
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)]
public string UDID;
/// Adapter Bus Number
public int BusNumber;
/// Adapter Driver Number
public int DriverNumber;
/// Adapter Function Number
public int FunctionNumber;
/// Adapter Vendor ID
public int VendorID;
/// Adapter Adapter name
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)]
public string AdapterName;
/// Adapter Display name
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)]
public string DisplayName;
/// Adapter Present status
public int Present;
/// Adapter Exist status
public int Exist;
/// Adapter Driver Path
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)]
public string DriverPath;
/// Adapter Driver Ext Path
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)]
public string DriverPathExt;
/// Adapter PNP String
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)]
public string PNPString;
/// OS Display Index
public int OSDisplayIndex;
}
/// ADLAdapterInfo Array
[StructLayout(LayoutKind.Sequential)]
public struct ADLAdapterInfoArray
{
/// ADLAdapterInfo Array
[MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)ADL.ADL_MAX_ADAPTERS)]
public ADLAdapterInfo[] ADLAdapterInfo;
}
/// ADLAdapterInfoX2 Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLAdapterInfoX2
{
/// The size of the structure
public int Size;
/// Adapter Index
public int AdapterIndex;
/// Adapter UDID
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)]
public string UDID;
/// Adapter Bus Number
public int BusNumber;
/// Adapter Device Number
public int DeviceNumber;
/// Adapter Function Number
public int FunctionNumber;
/// Adapter Vendor ID
public int VendorID;
/// Adapter Adapter name
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_DISPLAY_NAME)]
public string AdapterName;
/// Adapter Display name
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_DISPLAY_NAME)]
public string DisplayName;
/// Adapter Present status
public int Present;
/// Adapter Exist status
public int Exist;
/// Adapter Driver Path
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)]
public string DriverPath;
/// Adapter Driver Ext Path
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)]
public string DriverPathExt;
/// Adapter PNP String
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)]
public string PNPString;
/// OS Display Index
public int OSDisplayIndex;
/// Display Info Mask
public int InfoMask;
/// Display Info Value
public int InfoValue;
}
#endregion ADLAdapterInfo
#region ADLDisplayInfo
/// ADLDisplayEDIDData Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLDisplayEDIDData
{
/// Size
public int Size;
/// Flag
public int Flag;
/// EDIDSize
public int EDIDSize;
/// Block Index
public int BlockIndex;
/// EDIDData [256]
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_EDIDDATA_SIZE)]
public string EDIDData;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public int[] Reserved;
}
/// ADLDDCInfo2 Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLDDCInfo2
{
/// Size of the structure.
public int Size;
/// Whether this display device support DDC
public int SupportsDDC;
/// Returns the manufacturer ID of the display device. Should be zeroed if this information is not available.
public int ManufacturerID;
/// Returns the product ID of the display device. Should be zeroed if this informatiadlon is not available.
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)]
public string DisplayName;
/// Returns the maximum Horizontal supported resolution. Should be zeroed if this information is not available.
public int MaxHResolution;
/// Returns the maximum Vertical supported resolution. Should be zeroed if this information is not available.
public int MaxVResolution;
/// Returns the maximum supported refresh rate. Should be zeroed if this information is not available.
public int MaxRefresh;
/// Returns the display device preferred timing mode's horizontal resolution.
public int PTMCx;
/// Returns the display device preferred timing mode's vertical resolution.
public int PTMCy;
/// Returns the display device preferred timing mode's refresh rate.
public int PTMRefreshRate;
/// Return EDID flags.
public int DDCInfoFlag;
/// Returns 1 if the display supported packed pixel, 0 otherwise.
public int PackedPixelSupported;
/// Returns the Pixel formats the display supports DDCInfo Pixel Formats.
public int PanelPixelFormat;
/// Return EDID serial ID.
public int SerialID;
/// Return minimum monitor luminance data.
public int MinLuminanceData;
/// Return average monitor luminance data.
public int AvgLuminanceData;
/// Return maximum monitor luminance data.
public int MaxLuminanceData;
/// Bit vector of supported transfer functions ADLSourceContentAttributes transfer functions (gamma).
public int SupportedTransferFunction;
/// Bit vector of supported color spaces ADLSourceContentAttributes color spaces.
public int SupportedColorSpace;
/// Display Red Chromaticity X coordinate multiplied by 10000.
public int NativeDisplayChromaticityRedX;
/// Display Red Chromaticity Y coordinate multiplied by 10000.
public int NativeDisplayChromaticityRedY;
/// Display Green Chromaticity X coordinate multiplied by 10000.
public int NativeDisplayChromaticityGreenX;
/// Display Green Chromaticity Y coordinate multiplied by 10000.
public int NativeDisplayChromaticityGreenY;
/// Display Blue Chromaticity X coordinate multiplied by 10000.
public int NativeDisplayChromaticityBlueX;
/// Display Blue Chromaticity Y coordinate multiplied by 10000.
public int NativeDisplayChromaticityBlueY;
/// Display White Chromaticity X coordinate multiplied by 10000.
public int NativeDisplayChromaticityWhiteX;
/// Display White Chromaticity Y coordinate multiplied by 10000.
public int NativeDisplayChromaticityWhiteY;
/// Display diffuse screen reflectance 0-1 (100%) in units of 0.01.
public int DiffuseScreenReflectance;
/// Display specular screen reflectance 0-1 (100%) in units of 0.01.
public int SpecularScreenReflectance;
/// Bit vector of supported color spaces ADLDDCInfo2 HDR support options.
public int SupportedHDR;
/// Bit vector for freesync flags.
public int FreesyncFlags;
/// Return minimum monitor luminance without dimming data.
public int MinLuminanceNoDimmingData;
/// Returns the maximum backlight maximum luminance. Should be zeroed if this information is not available.
public int MaxBacklightMaxLuminanceData;
/// Returns the minimum backlight maximum luminance. Should be zeroed if this information is not available.
public int MinBacklightMaxLuminanceData;
/// Returns the maximum backlight minimum luminance. Should be zeroed if this information is not available.
public int MaxBacklightMinLuminanceData;
/// Returns the minimum backlight maximum luminance. Should be zeroed if this information is not available.
public int MinBacklightMinLuminanceData;
/// Reserved
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public int[] Reserved;
}
public struct ConvertedDDCInfoFlag
{
/// Indicates the display is a projector .
public bool PROJECTORDEVICE;
/// Indicates the display has an EDID extension
public bool EDIDEXTENSION;
/// Indicates the display is a digital device
public bool DIGITALDEVICE;
/// Indicates the display has HDMI audio capabilities
public bool HDMIAUDIODEVICE;
/// Indicates the display supports AI
public bool SUPPORTS_AI;
/// Indicates the display supports xvYCC601
public bool SUPPORT_xvYCC601;
/// Indicates the display supports xvYCC709
public bool SUPPORT_xvYCC709;
}
public struct ConvertedSupportedHDR
{
/// HDR10/CEA861.3 HDR supported
public bool CEA861_3;
/// DolbyVision HDR supported
public bool DOLBYVISION;
/// FreeSync HDR supported.
public bool FREESYNC_HDR;
}
/// ADLDisplayID Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLDisplayID
{
/// Display Logical Index
public int DisplayLogicalIndex;
/// Display Physical Index
public int DisplayPhysicalIndex;
/// Adapter Logical Index
public int DisplayLogicalAdapterIndex;
/// Adapter Physical Index
public int DisplayPhysicalAdapterIndex;
}
/// ADLDisplayInfo Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLDisplayInfo
{
/// Display Index
public ADLDisplayID DisplayID;
/// Display Controller Index
public int DisplayControllerIndex;
/// Display Name
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)]
public string DisplayName;
/// Display Manufacturer Name
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = (int)ADL.ADL_MAX_PATH)]
public string DisplayManufacturerName;
/// Display Type : The Display type. CRT, TV,CV,DFP are some of display types,
public int DisplayType;
/// Display output type
public int DisplayOutputType;
/// Connector type
public int DisplayConnector;
/// Indicating the display info bits' mask.
public int DisplayInfoMask;
/// Indicating the display info value.
public int DisplayInfoValue;
}
public struct ConvertedDisplayInfoValue
{
/// Indicates the display is connected .
public bool DISPLAYCONNECTED;
/// Indicates the display is mapped within OS
public bool DISPLAYMAPPED;
/// Indicates the display can be forced
public bool FORCIBLESUPPORTED;
/// Indicates the display supports genlock
public bool GENLOCKSUPPORTED;
/// Indicates the display is an LDA display.
public bool LDA_DISPLAY;
/// Indicates the display supports 2x Horizontal stretch
public bool MANNER_SUPPORTED_2HSTRETCH;
///
public bool MANNER_SUPPORTED_2VSTRETCH;
/// Indicates the display supports cloned desktops
public bool MANNER_SUPPORTED_CLONE;
/// Indicates the display supports extended desktops
public bool MANNER_SUPPORTED_EXTENDED;
/// Indicates the display supports N Stretched on 1 GPU
public bool MANNER_SUPPORTED_NSTRETCH1GPU;
/// Indicates the display supports N Stretched on N GPUs
public bool MANNER_SUPPORTED_NSTRETCHNGPU;
/// Reserved display info flag #2
public bool MANNER_SUPPORTED_RESERVED2;
/// Reserved display info flag #3
public bool MANNER_SUPPORTED_RESERVED3;
/// Indicates the display supports single desktop
public bool MANNER_SUPPORTED_SINGLE;
/// Indicates the display supports overriding the mode timing
public bool MODETIMING_OVERRIDESSUPPORTED;
/// Indicates the display supports multi-vpu
public bool MULTIVPU_SUPPORTED;
/// Indicates the display is non-local to this machine
public bool NONLOCAL;
/// Indicates the display is a projector
public bool SHOWTYPE_PROJECTOR;
}
/// ADLDisplayConfig Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLDisplayConfig
{
/// Size of this data structure
public long Size;
/// HDTV Connector Type
public long ConnectorType;
/// HDTV Capabilities themselves
public long DeviceData;
/// Overridden HDTV capabilities
public long OverriddedDeviceData;
/// Reserved for future use
public long Reserved;
}
/// ADLDisplayMap Structure
[StructLayout(LayoutKind.Sequential)]
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.
public int DisplayMapIndex;
/// The Display Mode for the current map.
public ADLMode DisplayMode;
/// The number of display targets belongs to this map
public int NumDisplayTarget;
/// The first target array index in the Target array
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.
public int DisplayMapMask;
/// The bit mask identifies the display status. The detailed definition is in ADL_DISPLAY_DISPLAYMAP_MANNER_xxx.
public int DisplayMapValue;
}
/// ADLDisplayMapArray Array
[StructLayout(LayoutKind.Sequential)]
public struct ADLDisplayMapArray
{
/// ADLAdapterInfo Array
[MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)ADL.ADL_MAX_DISPLAYS)]
public ADLDisplayMap[] ADLDisplayMap;
}
/// ADLAdapterCaps Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLAdapterCapsX2
{
/// AdapterID for this adapter
public int AdapterID;
/// Number of controllers for this adapter.
public int NumControllers;
/// Number of displays for this adapter.
public int NumDisplays;
/// Number of overlays for this adapter.
public int NumOverlays;
/// Number of GLSyncConnectors.
public int NumOfGLSyncConnectors;
/// The bit mask identifies the adapter caps.
public int CapsMask;
/// The bit identifies the adapter caps define_adapter_caps.
public int CapsValue;
/// Number of Connectors for this adapter.
public int NumConnectors;
}
/// ADLPossibleMap Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLPossibleMap
{
/// Index
public int Index;
/// Adapter Index.
public int AdapterIndex;
/// Display Map Number
public int NumDisplayMap;
/// The DisplayMaps being tested
public ADLDisplayMap DisplayMaps;
/// Number of Display Targets
public int NumDisplayTarget;
/// The DisplayTargets being tested
public ADLDisplayTarget DisplayTargets;
}
/// ADLPossibleMapping Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLPossibleMapping
{
/// Display Index
public int DisplayIndex;
/// Display Controller Index
public int DisplayControllerIndex;
/// The display manner options supported
public int DisplayMannerSupported;
}
/// ADLPossibleMapResult Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLPossibleMapResult
{
/// Index
public int Index;
// The bit mask and value identifies the number of bits PossibleMapResult is currently using. It will be the sum all the bit definitions defined in ADL_DISPLAY_POSSIBLEMAPRESULT_VALID.
/// Display Controller Index
public int PossibleMapResultMask;
/// The display manner options supported
public int PossibleMapResulValue;
}
#endregion ADLDisplayInfo
#region ADLSLS
/// ADLSLSGrid Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLSLSGrid
{
/// The Adapter index
public int AdapterIndex;
/// The grid index
public int SLSGridIndex;
/// The grid row.
public int SLSGridRow;
/// The grid column
public int SLSGridColumn;
/// The grid bit mask identifies the number of bits DisplayMap is currently using.
public int SLSGridMask;
/// The grid bit value identifies the display status.
public int SLSGridValue;
}
/// ADLSLSMap Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLSLSMap
{
/// The Adapter Index
public int AdapterIndex;
/// The current display map index. It is the OS Desktop index.
public int SLSMapIndex;
/// The current grid
public ADLSLSGrid Grid;
/// OS Surface Index
public int SurfaceMapIndex;
/// Screen orientation. E.g., 0, 90, 180, 270.
public int Orientation;
/// The number of display targets belongs to this map.
public int NumSLSTarget;
/// The first target array index in the Target array.
public int FirstSLSTargetArrayIndex;
/// The number of native modes belongs to this map.
public int NumNativeMode;
/// The first native mode array index in the native mode array.
public int FirstNativeModeArrayIndex;
/// The number of bezel modes belongs to this map.
public int NumBezelMode;
/// The first bezel mode array index in the native mode array
public int FirstBezelModeArrayIndex;
/// The number of bezel offsets belongs to this map.
public int NumBezelOffset;
/// The first bezel offset array index in the native mode array
public int FirstBezelOffsetArrayIndex;
/// Bitmask identifies display map status
public int SLSMapMask;
/// Bitmask identifies display map status
public int SLSMapValue;
}
/// ADLSLSTarget Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLSLSTarget
{
/// The Adapter Index
public int AdapterIndex;
/// The SLS map index.
public int SLSMapIndex;
/// The target ID.
public ADLDisplayTarget DisplayTarget;
/// Target postion X in SLS grid
public int SLSGridPositionX;
/// Target postion Y in SLS grid
public int SLSGridPositionY;
/// The view size width, height and rotation angle per SLS Target.
public ADLMode ViewSize;
/// The bit mask identifies the bits in iSLSTargetValue are currently used.
public int SLSTargetMask;
/// The bit mask identifies status info.
public int SLSTargetValue;
}
/// ADLSLSTarget Array
[StructLayout(LayoutKind.Sequential)]
public struct ADLSLSTargetArray
{
/// ADLAdapterInfo Array
[MarshalAs(UnmanagedType.ByValArray, SizeConst = (int)ADL.ADL_MAX_ADAPTERS)]
public ADLSLSTarget[] ADLSLSTarget;
}
/// ADLSLSMode Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLSLSMode
{
/// The Adapter Index
public int AdapterIndex;
/// The current display map index. It is the OS Desktop index.
public int SLSMapIndex;
/// The mode index.
public int SLSModeIndex;
/// The target ID.
public ADLMode DisplayMode;
/// The bit mask identifies the number of bits Mode is currently using.
public int SLSNativeModeMask;
/// The bit mask identifies the display status.
public int SLSNativeModeValue;
}
/// ADLBezelTransientMode Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLBezelTransientMode
{
/// The Adapter Index
public int AdapterIndex;
/// SLS Map Index.
public int SLSMapIndex;
/// SLS Mode Index.
public int SLSModeIndex;
/// The target ID.
public ADLMode DisplayMode;
/// The number of bezel offsets belongs to this map.
public int NumBezelOffset;
/// The first bezel offset array index in the native mode array.
public int FirstBezelOffsetArrayIndex;
/// The bit mask identifies the bits this structure is currently using.
public int SLSBezelTransientModeMask;
/// The bit mask identifies the display status.
public int SLSBezelTransientModeValue;
}
/// ADLSLSOffset Structure
[StructLayout(LayoutKind.Sequential)]
public struct ADLSLSOffset
{
/// The Adapter Index
public int AdapterIndex;
/// The current display map index. It is the OS Desktop index.
public int SLSMapIndex;
/// The target ID.
public ADLDisplayID DisplayID;
/// SLS Bezel Mode Index.
public int BezelModeIndex;
/// SLS Bezel Offset X.
public int BezelOffsetX;
/// SLS Bezel Offset Y.
public int BezelOffsetY;
/// SLS Display Width.
public int DisplayWidth;
/// SLS Display Height.
public int DisplayHeight;
/// The bit mask identifies the number of bits Offset is currently using.
public int BezelOffsetMask;
/// The bit mask identifies the display status.
public int BezelOffsetValue;
}
#endregion ADLSLS
#endregion Export Struct
#region ADL Class
/// ADL Class
public static class ADL
{
#region Internal Constant
/// Selects all adapters instead of aparticular single adapter
public const int ADL_ADAPTER_INDEX_ALL = -1;
/// Define the maximum char
public const int ADL_MAX_CHAR = 4096;
/// Define the maximum path
public const int ADL_MAX_PATH = 256;
/// Define the maximum adapters
public const int ADL_MAX_ADAPTERS = 250;
/// Define the maximum displays
public const int ADL_MAX_DISPLAYS = 150;
/// Define the maximum device name length
public const int ADL_MAX_DEVICENAME = 32;
/// Define the maximum EDID Data length
public const int ADL_MAX_EDIDDATA_SIZE = 256; // number of UCHAR
/// Define the maximum display names
public const int ADL_MAX_DISPLAY_NAME = 256;
// Result Codes
/// ADL function completed successfully.
public const int ADL_OK = 0;
/// Generic Error.Most likely one or more of the Escape calls to the driver failed!
public const int ADL_ERR = -1;
/// Call can't be made due to disabled adapter.
public const int ADL_ERR_DISABLED_ADAPTER = -10;
/// Invalid ADL index passed.
public const int ADL_ERR_INVALID_ADL_IDX = -5;
/// Invalid Callback.
public const int ADL_ERR_INVALID_CALLBACK = -11;
/// Invalid controller index passed.
public const int ADL_ERR_INVALID_CONTROLLER_IDX = -6;
/// Invalid display index passed.
public const int ADL_ERR_INVALID_DISPLAY_IDX = -7;
/// One of the parameter passed is invalid.
public const int ADL_ERR_INVALID_PARAM = -3;
/// One of the parameter size is invalid.
public const int ADL_ERR_INVALID_PARAM_SIZE = -4;
/// There's no Linux XDisplay in Linux Console environment.
public const int ADL_ERR_NO_XDISPLAY = -21;
/// ADL not initialized.
public const int ADL_ERR_NOT_INIT = -2;
/// Function not supported by the driver.
public const int ADL_ERR_NOT_SUPPORTED = -8;
/// Null Pointer error.
public const int ADL_ERR_NULL_POINTER = -9;
/// Display Resource conflict.
public const int ADL_ERR_RESOURCE_CONFLICT = -12;
/// Err Set incomplete
public const int ADL_ERR_SET_INCOMPLETE = -20;
/// All OK but need mode change.
public const int ADL_OK_MODE_CHANGE = 2;
/// All OK, but need restart.
public const int ADL_OK_RESTART = 3;
/// All OK, but need to wait
public const int ADL_OK_WAIT = 4;
/// All OK, but with warning.
public const int ADL_OK_WARNING = 1;
/// Define the driver ok
public const int ADL_DRIVER_OK = 0;
/// Maximum number of GL-Sync ports on the GL-Sync module
public const int ADL_MAX_GLSYNC_PORTS = 8;
/// Maximum number of GL-Sync ports on the GL-Sync module
public const int ADL_MAX_GLSYNC_PORT_LEDS = 8;
/// Maximum number of ADLModes for the adapter
public const int ADL_MAX_NUM_DISPLAYMODES = 1024;
/// Define true
public const int ADL_TRUE = 1;
/// Maximum number of ADLModes for the adapter
public const int ADL_FALSE = 0;
/// Indicates the active dongle, all types
public const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE = 12;
/// Indicates the Active dongle DP->DVI(double link) connection type is valid.
public const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE_DP_DVI_DL = 6;
/// Indicates the Active dongle DP->DVI(single link) connection type is valid.
public const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE_DP_DVI_SL = 5;
/// Indicates the Active dongle DP->HDMI connection type is valid.
public const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE_DP_HDMI = 7;
/// Indicates the Active dongle DP->VGA connection type is valid.
public const int ADL_CONNECTION_TYPE_ACTIVE_DONGLE_DP_VGA = 8;
/// Indicates the DISPLAY PORT connection type is valid.
public const int ADL_CONNECTION_TYPE_DISPLAY_PORT = 4;
/// Indicates the DVI_I connection type is valid.
public const int ADL_CONNECTION_TYPE_DVI = 1;
/// Indicates the DVI_SL connection type is valid.
public const int ADL_CONNECTION_TYPE_DVI_SL = 2;
/// Indicates the HDMI connection type is valid.
public const int ADL_CONNECTION_TYPE_HDMI = 3;
/// Indicates the MST type is valid.
public const int ADL_CONNECTION_TYPE_MST = 11;
/// Indicates the Active dongle DP->VGA connection type is valid.
public const int ADL_CONNECTION_TYPE_PASSIVE_DONGLE_DP_DVI = 10;
/// Indicates the Passive dongle DP->HDMI connection type is valid.
public const int ADL_CONNECTION_TYPE_PASSIVE_DONGLE_DP_HDMI = 9;
/// Indicates the VGA connection type is valid.
public const int ADL_CONNECTION_TYPE_VGA = 0;
/// Indicates the Virtual Connection Type.
public const int ADL_CONNECTION_TYPE_VIRTUAL = 13;
/// Indicates Active Dongle-JP Connector type.
public const int ADL_CONNECTOR_TYPE_ATICVDONGLE_JP = 5;
/// Indicates Active Dongle-NA Connector type.
public const int ADL_CONNECTOR_TYPE_ATICVDONGLE_NA = 4;
/// Indicates Active Dongle-NONI2C Connector type.
public const int ADL_CONNECTOR_TYPE_ATICVDONGLE_NONI2C = 6;
/// Indicates Active Dongle-NONI2C-D Connector type.
public const int ADL_CONNECTOR_TYPE_ATICVDONGLE_NONI2C_D = 7;
/// Indicates Display port Connector type.
public const int ADL_CONNECTOR_TYPE_DISPLAYPORT = 10;
/// Indicates DVI-D Connector type.
public const int ADL_CONNECTOR_TYPE_DVI_D = 2;
/// Indicates DVI-I Connector type.
public const int ADL_CONNECTOR_TYPE_DVI_I = 3;
/// Indicates EDP Connector type.
public const int ADL_CONNECTOR_TYPE_EDP = 11;
/// Indicates HDMI-Type A Connector type.
public const int ADL_CONNECTOR_TYPE_HDMI_TYPE_A = 8;
/// Indicates HDMI-Type B Connector type.
public const int ADL_CONNECTOR_TYPE_HDMI_TYPE_B = 9;
/// Indicates MiniDP Connector type.
public const int ADL_CONNECTOR_TYPE_MINI_DISPLAYPORT = 12;
/// Indicates Unknown Connector type.
public const int ADL_CONNECTOR_TYPE_UNKNOWN = 0;
/// Indicates USB type C Connector type.
public const int ADL_CONNECTOR_TYPE_USB_TYPE_C = 14;
/// Indicates VGA Connector type.
public const int ADL_CONNECTOR_TYPE_VGA = 1;
/// Indicates Virtual Connector type.
public const int ADL_CONNECTOR_TYPE_VIRTUAL = 13;
// ADL Display Connector Types
/// Indicates Unknown Display Connector type.
public const int ADL_DISPLAY_CONTYPE_UNKNOWN = 0;
/// Indicates VGA Display Connector type.
public const int ADL_DISPLAY_CONTYPE_VGA = 1;
/// Indicates DVI-D Display Connector type.
public const int ADL_DISPLAY_CONTYPE_DVI_D = 2;
/// Indicates DVI-I Display Connector type.
public const int ADL_DISPLAY_CONTYPE_DVI_I = 3;
/// Indicates ATICV NTSC Dongle Display Connector type.
public const int ADL_DISPLAY_CONTYPE_ATICVDONGLE_NTSC = 4;
/// Indicates ATICV Japanese Display Connector type.
public const int ADL_DISPLAY_CONTYPE_ATICVDONGLE_JPN = 5;
/// Indicates ATICV non-I2C Japanese Display Connector type.
public const int ADL_DISPLAY_CONTYPE_ATICVDONGLE_NONI2C_JPN = 6;
/// Indicates ATICV non-I2C NTSC Display Connector type.
public const int ADL_DISPLAY_CONTYPE_ATICVDONGLE_NONI2C_NTSC = 7;
/// Indicates Proprietary Display Connector type.
public const int ADL_DISPLAY_CONTYPE_PROPRIETARY = 8;
/// Indicates HDMI Type A Display Connector type.
public const int ADL_DISPLAY_CONTYPE_HDMI_TYPE_A = 10;
/// Indicates HDMI Type B Display Connector type.
public const int ADL_DISPLAY_CONTYPE_HDMI_TYPE_B = 11;
/// Indicates S-Video Display Connector type.
public const int ADL_DISPLAY_CONTYPE_SVIDEO = 12;
/// Indicates Composite Display Connector type.
public const int ADL_DISPLAY_CONTYPE_COMPOSITE = 13;
/// Indicates RCA 3-component Display Connector type.
public const int ADL_DISPLAY_CONTYPE_RCA_3COMPONENT = 14;
/// Indicates DisplayPort Display Connector type.
public const int ADL_DISPLAY_CONTYPE_DISPLAYPORT = 15;
/// Indicates EDP Display Connector type.
public const int ADL_DISPLAY_CONTYPE_EDP = 16;
/// Indicates Wireless Display Connector type.
public const int ADL_DISPLAY_CONTYPE_WIRELESSDISPLAY = 17;
/// Indicates USB Type-C Display Connector type.
public const int ADL_DISPLAY_CONTYPE_USB_TYPE_C = 18;
// Display Info Constants
/// Indicates the display is connected .
public const int ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED = 0x00000001;
/// Indicates the display is mapped within OS
public const int ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED = 0x00000002;
/// Indicates the display can be forced
public const int ADL_DISPLAY_DISPLAYINFO_FORCIBLESUPPORTED = 0x00000008;
/// Indicates the display supports genlock
public const int ADL_DISPLAY_DISPLAYINFO_GENLOCKSUPPORTED = 0x00000010;
/// Indicates the display is an LDA display.
public const int ADL_DISPLAY_DISPLAYINFO_LDA_DISPLAY = 0x00000040;
/// Indicates the display supports 2x Horizontal stretch
public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_2HSTRETCH = 0x00000800;
/// Indicates the display supports 2x Vertical stretch
public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_2VSTRETCH = 0x00000400;
/// Indicates the display supports cloned desktops
public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_CLONE = 0x00000200;
/// Indicates the display supports extended desktops
public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_EXTENDED = 0x00001000;
/// Indicates the display supports N Stretched on 1 GPU
public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_NSTRETCH1GPU = 0x00010000;
/// Indicates the display supports N Stretched on N GPUs
public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_NSTRETCHNGPU = 0x00020000;
/// Reserved display info flag #2
public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_RESERVED2 = 0x00040000;
/// Reserved display info flag #3
public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_RESERVED3 = 0x00080000;
/// Indicates the display supports single desktop
public const int ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_SINGLE = 0x00000100;
/// Indicates the display supports overriding the mode timing
public const int ADL_DISPLAY_DISPLAYINFO_MODETIMING_OVERRIDESSUPPORTED = 0x00000080;
/// Indicates the display supports multi-vpu
public const int ADL_DISPLAY_DISPLAYINFO_MULTIVPU_SUPPORTED = 0x00000020;
/// Indicates the display is non-local to this machine
public const int ADL_DISPLAY_DISPLAYINFO_NONLOCAL = 0x00000004;
/// Indicates the display is a projector
public const int ADL_DISPLAY_DISPLAYINFO_SHOWTYPE_PROJECTOR = 0x00100000;
// Display Mode Constants
/// Indicates the display is in interlaced mode
public const int ADL_DISPLAY_MODE_INTERLACED_FLAG = 2;
/// Indicates the display is in progressive mode
public const int ADL_DISPLAY_MODE_PROGRESSIVE_FLAG = 0;
/// Indicates the display colour format is 565
public const int ADL_DISPLAY_MODE_COLOURFORMAT_565 = 0x00000001;
/// Indicates the display colour format is 8888
public const int ADL_DISPLAY_MODE_COLOURFORMAT_8888 = 0x00000002;
/// Indicates the display orientation is normal position
public const int ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_000 = 0x00000004;
/// Indicates the display is in the 90 degree position
public const int ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_090 = 0x00000008;
/// Indicates the display in the 180 degree position
public const int ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_180 = 0x00000010;
/// Indicates the display is in the 270 degree position
public const int ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_270 = 0x00000020;
/// Indicates the display refresh rate is exact
public const int ADL_DISPLAY_MODE_REFRESHRATE_ONLY = 0x00000080;
/// Indicates the display refresh rate is rounded
public const int ADL_DISPLAY_MODE_REFRESHRATE_ROUNDED = 0x00000040;
// DDCInfoX2 DDCInfo Flag values
/// Indicates the display is a projector
public const int ADL_DISPLAYDDCINFOEX_FLAG_PROJECTORDEVICE = (1 << 0);
/// Indicates the display is a projector
public const int ADL_DISPLAYDDCINFOEX_FLAG_EDIDEXTENSION = (1 << 1);
/// Indicates the display is a projector
public const int ADL_DISPLAYDDCINFOEX_FLAG_DIGITALDEVICE = (1 << 2);
/// Indicates the display is a projector
public const int ADL_DISPLAYDDCINFOEX_FLAG_HDMIAUDIODEVICE = (1 << 3);
/// Indicates the display is a projector
public const int ADL_DISPLAYDDCINFOEX_FLAG_SUPPORTS_AI = (1 << 4);
/// Indicates the display is a projector
public const int ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC601 = (1 << 5);
/// Indicates the display is a projector
public const int ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC709 = (1 << 6);
// HDR Constants
/// HDR10/CEA861.3 HDR supported
public const int ADL_HDR_CEA861_3 = 0x0001;
/// DolbyVision HDR supported
public const int ADL_HDR_DOLBYVISION = 0x0002;
/// FreeSync HDR supported.
public const int ADL_HDR_FREESYNC_HDR = 0x0004;
// DisplayMap constants
// ADL_DISPLAY_DISPLAYMAP_MANNER_ Definitions
// for ADLDisplayMap.iDisplayMapMask and ADLDisplayMap.iDisplayMapValue
// (bit-vector)
/// Indicates the display map manner is reserved
public const int ADL_DISPLAY_DISPLAYMAP_MANNER_RESERVED = 0x00000001;
/// Indicates the display map manner is not active
public const int ADL_DISPLAY_DISPLAYMAP_MANNER_NOTACTIVE = 0x00000002;
/// Indicates the display map manner is single screens
public const int ADL_DISPLAY_DISPLAYMAP_MANNER_SINGLE = 0x00000004;
/// Indicates the display map manner is clone of another display
public const int ADL_DISPLAY_DISPLAYMAP_MANNER_CLONE = 0x00000008;
/// Indicates the display map manner is reserved
public const int ADL_DISPLAY_DISPLAYMAP_MANNER_RESERVED1 = 0x00000010; // Removed NSTRETCH
/// Indicates the display map manner is horizontal stretch
public const int ADL_DISPLAY_DISPLAYMAP_MANNER_HSTRETCH = 0x00000020;
/// Indicates the display map manner is vertical stretch
public const int ADL_DISPLAY_DISPLAYMAP_MANNER_VSTRETCH = 0x00000040;
/// Indicates the display map manner is VLD
public const int ADL_DISPLAY_DISPLAYMAP_MANNER_VLD = 0x00000080;
// ADL_DISPLAY_DISPLAYMAP_OPTION_ Definitions
// for iOption in function ADL_Display_DisplayMapConfig_Get
// (bit-vector)
/// Indicates the display map option is GPU Info
public const int ADL_DISPLAY_DISPLAYMAP_OPTION_GPUINFO = 0x00000001;
// ADL_DISPLAY_DISPLAYTARGET_ Definitions
// for ADLDisplayTarget.iDisplayTargetMask and ADLDisplayTarget.iDisplayTargetValue
// (bit-vector)
/// Indicates the display target is preferred
public const int ADL_DISPLAY_DISPLAYTARGET_PREFERRED = 0x00000001;
// ADL_DISPLAY_POSSIBLEMAPRESULT_VALID Definitions
// for ADLPossibleMapResult.iPossibleMapResultMask and ADLPossibleMapResult.iPossibleMapResultValue
// (bit-vector)
/// Indicates the display map result is valid
public const int ADL_DISPLAY_POSSIBLEMAPRESULT_VALID = 0x00000001;
/// Indicates the display map result supports bezels
public const int ADL_DISPLAY_POSSIBLEMAPRESULT_BEZELSUPPORTED = 0x00000002;
/// Indicates the display map result supports overlap
public const int ADL_DISPLAY_POSSIBLEMAPRESULT_OVERLAPSUPPORTED = 0x00000004;
#endregion Internal Constant
#region Internal Enums
public enum ADLConnectionType
{
VGA = 0,
DVI = 1,
DVI_SL = 2,
HDMI = 4,
DisplayPort = 4,
ActiveDongleDPToDVI_SL = 5,
ActiveDongleDPToDVI_DL = 6,
ActiveDongleDPToHDMI = 7,
ActiveDongleDPToVGA = 8,
PassiveDongleDPToHDMI = 9,
PassiveDongleDPToDVI = 10,
MST = 11,
ActiveDongle = 12,
Virtual = 13
}
public enum ADLDisplayConnectionType
{
Unknown = 0,
VGA = 1,
DVI_D = 2,
DVI_I = 3,
HDMI = 4,
ATICV_NTSC_Dongle = 4,
ATICV_JPN_Dongle = 5,
ATICV_NONI2C_NTSC_Dongle = 6,
ATICV_NONI2C_JPN_Dongle = 7,
Proprietary = 8,
HDMITypeA = 10,
HTMITypeB = 11,
SVideo = 12,
Composite = 13,
RCA_3Component = 14,
DisplayPort = 15,
EDP = 16,
WirelessDisplay = 17,
USBTypeC = 18
}
public enum ADLDisplayModeFlag
{
ColourFormat565 = 1,
ColourFormat8888 = 2,
Degrees0 = 4,
Degrees90 = 8,
Degrees180 = 10,
Degrees270 = 20,
ExactRefreshRate = 80,
RoundedRefreshRate = 40
}
public enum ADLDisplayModeInterlacing
{
Progressive = 0,
Interlaced = 2
}
#endregion Internal Enums
#region Class ADLImport
/// ADLImport class
private static class ADLImport
{
#region Internal Constant
/// Atiadlxx_FileName
public const string Atiadlxx_FileName = "atiadlxx.dll";
/// Kernel32_FileName
public const string Kernel32_FileName = "kernel32.dll";
#endregion Internal Constant
#region DLLImport
[DllImport(Kernel32_FileName)]
public static extern HMODULE GetModuleHandle (string moduleName);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Main_Control_Create(ADL_Main_Memory_Alloc callback, int enumConnectedAdapters, out IntPtr contextHandle);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Main_Control_Destroy(IntPtr contextHandle);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Flush_Driver_Data(IntPtr ADLContextHandle, int adapterIndex);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Adapter_NumberOfAdapters_Get(IntPtr contextHandle, ref int numAdapters);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Adapter_Active_Get(IntPtr ADLContextHandle, int adapterIndex, ref int status);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_AdapterX2_Caps(IntPtr ADLContextHandle, int adapterIndex, out ADLAdapterCapsX2 adapterCapabilities);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Adapter_AdapterInfo_Get(IntPtr ADLContextHandle, int inputSize, out IntPtr AdapterInfoArray);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Adapter_AdapterInfoX2_Get(IntPtr ADLContextHandle, out IntPtr AdapterInfoArray);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Adapter_AdapterInfoX3_Get(IntPtr ADLContextHandle, int adapterIndex, out int numAdapters, out IntPtr AdapterInfoArray);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Adapter_AdapterInfoX4_Get(IntPtr ADLContextHandle, int adapterIndex, out int numAdapters, out IntPtr AdapterInfoX2Array);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Display_DDCInfo2_Get(IntPtr contextHandle, int adapterIndex, int displayIndex, out ADLDDCInfo2 DDCInfo);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Display_DisplayInfo_Get(IntPtr ADLContextHandle, int adapterIndex, ref int numDisplays, out IntPtr displayInfoArray, int forceDetect);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Display_DeviceConfig_Get(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, out ADLDisplayConfig displayConfig);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Display_HDRState_Get(IntPtr ADLContextHandle, int adapterIndex, ADLDisplayID displayID, out int support, out int enable);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Display_Modes_Get(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, out int numModes, out IntPtr modes);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Display_Modes_Set(IntPtr ADLContextHandle, int adapterIndex, int displayIndex, int numModes, ref ADLMode modes);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Display_DisplayMapConfig_Get(IntPtr ADLContextHandle, int adapterIndex, out int numDisplayMap, out IntPtr displayMap, out int numDisplayTarget, out IntPtr displayTarget, int options);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Display_DisplayMapConfig_Set(IntPtr ADLContextHandle, int adapterIndex, int numDisplayMap, ref ADLDisplayMap displayMap, int numDisplayTarget, ref ADLDisplayTarget displayTarget);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL2_Display_DisplayMapConfig_Validate(IntPtr ADLContextHandle, int adapterIndex, int numPossibleMap, ref ADLPossibleMap possibleMaps, out int numPossibleMapResult, ref IntPtr possibleMapResult);
// ======================================
[DllImport(Atiadlxx_FileName)]
public static extern int ADL_Main_Control_Create (ADL_Main_Memory_Alloc callback, int enumConnectedAdapters);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL_Main_Control_Destroy ();
[DllImport(Atiadlxx_FileName)]
public static extern int ADL_Main_Control_IsFunctionValid (HMODULE module, string procName);
[DllImport(Atiadlxx_FileName)]
public static extern FARPROC ADL_Main_Control_GetProcAddress (HMODULE module, string procName);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL_Adapter_NumberOfAdapters_Get (ref int numAdapters);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL_Adapter_AdapterInfo_Get (out IntPtr info, int inputSize);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL_Adapter_Active_Get(int adapterIndex, ref int status);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL_Adapter_ID_Get(int adapterIndex, ref int adapterId);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL_AdapterX2_Caps(int adapterIndex, out ADLAdapterCapsX2 adapterCapabilities);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL_Display_DisplayInfo_Get(int adapterIndex, ref int numDisplays, out IntPtr displayInfoArray, int forceDetect);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL_Display_DeviceConfig_Get(int adapterIndex, int displayIndex, out ADLDisplayConfig displayConfig);
[DllImport(Atiadlxx_FileName)]
public static extern int ADL_Display_EdidData_Get(int adapterIndex, int displayIndex, ref ADLDisplayEDIDData EDIDData);
[DllImport(Atiadlxx_FileName)]
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)]
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)]
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)]
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)]
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)]
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)]
public static extern int ADL_Display_SLSMapIndex_Get(int adapterIndex, int ADLNumDisplayTarget, ref ADLDisplayTarget displayTarget, ref int SLSMapIndex);
#endregion DLLImport
}
#endregion Class ADLImport
#region Class ADLCheckLibrary
/// ADLCheckLibrary class
private class ADLCheckLibrary
{
#region Private Members
private HMODULE ADLLibrary = System.IntPtr.Zero;
#endregion Private Members
#region Static Members
/// new a private instance
private static ADLCheckLibrary ADLCheckLibrary_ = new ADLCheckLibrary();
#endregion Static Members
#region Constructor
/// Constructor
private ADLCheckLibrary ()
{
try
{
if (1 == ADLImport.ADL_Main_Control_IsFunctionValid(IntPtr.Zero, "ADL_Main_Control_Create"))
{
ADLLibrary = ADLImport.GetModuleHandle(ADLImport.Atiadlxx_FileName);
}
}
catch (DllNotFoundException) { }
catch (EntryPointNotFoundException) { }
catch (Exception) { }
}
#endregion Constructor
#region Destructor
/// Destructor to force calling ADL Destroy function before free up the ADL library
~ADLCheckLibrary ()
{
if (System.IntPtr.Zero != ADLCheckLibrary_.ADLLibrary)
{
ADLImport.ADL_Main_Control_Destroy();
}
}
#endregion Destructor
#region Static IsFunctionValid
/// Check the import function to see it exists or not
/// function name
/// return true, if function exists
public static bool IsFunctionValid (string functionName)
{
bool result = false;
if (System.IntPtr.Zero != ADLCheckLibrary_.ADLLibrary)
{
if (1 == ADLImport.ADL_Main_Control_IsFunctionValid(ADLCheckLibrary_.ADLLibrary, functionName))
{
result = true;
}
}
return result;
}
#endregion Static IsFunctionValid
#region Static GetProcAddress
/// Get the unmanaged function pointer
/// function name
/// return function pointer, if function exists
public static FARPROC GetProcAddress (string functionName)
{
FARPROC result = System.IntPtr.Zero;
if (System.IntPtr.Zero != ADLCheckLibrary_.ADLLibrary)
{
result = ADLImport.ADL_Main_Control_GetProcAddress(ADLCheckLibrary_.ADLLibrary, functionName);
}
return result;
}
#endregion Static GetProcAddress
}
#endregion Class ADLCheckLibrary
#region Export Functions
#region ADL_Main_Memory_Alloc
/// Build in memory allocation function
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
private static IntPtr ADL_Main_Memory_Alloc_ (int size)
{
IntPtr result = Marshal.AllocCoTaskMem(size);
return result;
}
#endregion ADL_Main_Memory_Alloc
#region ADL_Main_Memory_Free
/// Build in memory free function
/// input buffer
public static void ADL_Main_Memory_Free (IntPtr buffer)
{
if (IntPtr.Zero != buffer)
{
Marshal.FreeCoTaskMem(buffer);
}
}
#endregion ADL_Main_Memory_Free
#region ADL2_Main_Control_Create
/// ADL2_Main_Control_Create Delegates
public static ADL2_Main_Control_Create ADL2_Main_Control_Create
{
get
{
if (!ADL2_Main_Control_Create_Check && null == ADL2_Main_Control_Create_)
{
ADL2_Main_Control_Create_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Main_Control_Create"))
{
ADL2_Main_Control_Create_ = ADLImport.ADL2_Main_Control_Create;
}
}
return ADL2_Main_Control_Create_;
}
}
/// Private Delegate
private static ADL2_Main_Control_Create ADL2_Main_Control_Create_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Main_Control_Create_Check = false;
#endregion ADL2_Main_Control_Create
#region ADL2_Main_Control_Destroy
/// ADL2_Main_Control_Destroy Delegates
public static ADL2_Main_Control_Destroy ADL2_Main_Control_Destroy
{
get
{
if (!ADL2_Main_Control_Destroy_Check && null == ADL2_Main_Control_Destroy_)
{
ADL2_Main_Control_Destroy_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Main_Control_Destroy"))
{
ADL2_Main_Control_Destroy_ = ADLImport.ADL2_Main_Control_Destroy;
}
}
return ADL2_Main_Control_Destroy_;
}
}
/// Private Delegate
private static ADL2_Main_Control_Destroy ADL2_Main_Control_Destroy_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Main_Control_Destroy_Check = false;
#endregion ADL2_Main_Control_Destroy
#region ADL2_Flush_Driver_Data
/// ADL2_Flush_Driver_Data Delegates
public static ADL2_Flush_Driver_Data ADL2_Flush_Driver_Data
{
get
{
if (!ADL2_Flush_Driver_Data_Check && null == ADL2_Flush_Driver_Data_)
{
ADL2_Flush_Driver_Data_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Flush_Driver_Data"))
{
ADL2_Flush_Driver_Data_ = ADLImport.ADL2_Flush_Driver_Data;
}
}
return ADL2_Flush_Driver_Data_;
}
}
/// Private Delegate
private static ADL2_Flush_Driver_Data ADL2_Flush_Driver_Data_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Flush_Driver_Data_Check = false;
#endregion ADL2_Flush_Driver_Data
#region ADL2_Adapter_NumberOfAdapters_Get
/// ADL2_Adapter_NumberOfAdapters_Get Delegates
public static ADL2_Adapter_NumberOfAdapters_Get ADL2_Adapter_NumberOfAdapters_Get
{
get
{
if (!ADL2_Adapter_NumberOfAdapters_Get_Check && null == ADL2_Adapter_NumberOfAdapters_Get_)
{
ADL2_Adapter_NumberOfAdapters_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Adapter_NumberOfAdapters_Get"))
{
ADL2_Adapter_NumberOfAdapters_Get_ = ADLImport.ADL2_Adapter_NumberOfAdapters_Get;
}
}
return ADL2_Adapter_NumberOfAdapters_Get_;
}
}
/// Private Delegate
private static ADL2_Adapter_NumberOfAdapters_Get ADL2_Adapter_NumberOfAdapters_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Adapter_NumberOfAdapters_Get_Check = false;
#endregion ADL2_Adapter_NumberOfAdapters_Get
#region ADL2_Adapter_Active_Get
/// ADL2_Adapter_Active_Get Delegates
public static ADL2_Adapter_Active_Get ADL2_Adapter_Active_Get
{
get
{
if (!ADL2_Adapter_Active_Get_Check && null == ADL2_Adapter_Active_Get_)
{
ADL2_Adapter_Active_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Adapter_Active_Get"))
{
ADL2_Adapter_Active_Get_ = ADLImport.ADL2_Adapter_Active_Get;
}
}
return ADL2_Adapter_Active_Get_;
}
}
/// Private Delegate
private static ADL2_Adapter_Active_Get ADL2_Adapter_Active_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Adapter_Active_Get_Check = false;
#endregion ADL2_Adapter_Active_Get
#region ADL2_AdapterX2_Caps
/// ADL2_AdapterX2_Caps Delegates
public static ADL2_AdapterX2_Caps ADL2_AdapterX2_Caps
{
get
{
if (!ADL2_AdapterX2_Caps_Check && null == ADL2_AdapterX2_Caps_)
{
ADL2_AdapterX2_Caps_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_AdapterX2_Caps"))
{
ADL2_AdapterX2_Caps_ = ADLImport.ADL2_AdapterX2_Caps;
}
}
return ADL2_AdapterX2_Caps_;
}
}
/// Private Delegate
private static ADL2_AdapterX2_Caps ADL2_AdapterX2_Caps_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_AdapterX2_Caps_Check = false;
#endregion ADL2_AdapterX2_Caps
#region ADL2_Adapter_AdapterInfo_Get
/// ADL2_Adapter_AdapterInfo_Get Delegates
public static ADL2_Adapter_AdapterInfo_Get ADL2_Adapter_AdapterInfo_Get
{
get
{
if (!ADL2_Adapter_AdapterInfo_Get_Check && null == ADL2_Adapter_AdapterInfo_Get_)
{
ADL2_Adapter_AdapterInfo_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Adapter_AdapterInfo_Get"))
{
ADL2_Adapter_AdapterInfo_Get_ = ADLImport.ADL2_Adapter_AdapterInfo_Get;
}
}
return ADL2_Adapter_AdapterInfo_Get_;
}
}
/// Private Delegate
private static ADL2_Adapter_AdapterInfo_Get ADL2_Adapter_AdapterInfo_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Adapter_AdapterInfo_Get_Check = false;
#endregion ADL2_Adapter_AdapterInfo_Get
#region ADL2_Adapter_AdapterInfoX2_Get
/// ADL2_Adapter_AdapterInfoX2_Get Delegates
public static ADL2_Adapter_AdapterInfoX2_Get ADL2_Adapter_AdapterInfoX2_Get
{
get
{
if (!ADL2_Adapter_AdapterInfoX2_Get_Check && null == ADL2_Adapter_AdapterInfoX2_Get_)
{
ADL2_Adapter_AdapterInfoX2_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Adapter_AdapterInfoX2_Get"))
{
ADL2_Adapter_AdapterInfoX2_Get_ = ADLImport.ADL2_Adapter_AdapterInfoX2_Get;
}
}
return ADL2_Adapter_AdapterInfoX2_Get_;
}
}
/// Private Delegate
private static ADL2_Adapter_AdapterInfoX2_Get ADL2_Adapter_AdapterInfoX2_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Adapter_AdapterInfoX2_Get_Check = false;
#endregion ADL2_Adapter_AdapterInfoX2_Get
#region ADL2_Adapter_AdapterInfoX3_Get
/// ADL2_Adapter_AdapterInfoX3_Get Delegates
public static ADL2_Adapter_AdapterInfoX3_Get ADL2_Adapter_AdapterInfoX3_Get
{
get
{
if (!ADL2_Adapter_AdapterInfoX3_Get_Check && null == ADL2_Adapter_AdapterInfoX3_Get_)
{
ADL2_Adapter_AdapterInfoX3_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Adapter_AdapterInfoX3_Get"))
{
ADL2_Adapter_AdapterInfoX3_Get_ = ADLImport.ADL2_Adapter_AdapterInfoX3_Get;
}
}
return ADL2_Adapter_AdapterInfoX3_Get_;
}
}
/// Private Delegate
private static ADL2_Adapter_AdapterInfoX3_Get ADL2_Adapter_AdapterInfoX3_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Adapter_AdapterInfoX3_Get_Check = false;
#endregion ADL2_Adapter_AdapterInfoX3_Get
#region ADL2_Adapter_AdapterInfoX4_Get
/// ADL2_Adapter_AdapterInfoX4_Get Delegates
public static ADL2_Adapter_AdapterInfoX4_Get ADL2_Adapter_AdapterInfoX4_Get
{
get
{
if (!ADL2_Adapter_AdapterInfoX4_Get_Check && null == ADL2_Adapter_AdapterInfoX4_Get_)
{
ADL2_Adapter_AdapterInfoX4_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Adapter_AdapterInfoX4_Get"))
{
ADL2_Adapter_AdapterInfoX4_Get_ = ADLImport.ADL2_Adapter_AdapterInfoX4_Get;
}
}
return ADL2_Adapter_AdapterInfoX4_Get_;
}
}
/// Private Delegate
private static ADL2_Adapter_AdapterInfoX4_Get ADL2_Adapter_AdapterInfoX4_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Adapter_AdapterInfoX4_Get_Check = false;
#endregion ADL2_Adapter_AdapterInfoX4_Get
#region ADL2_Display_DDCInfo2_Get
/// ADL2_Display_DDCInfo2_Get Delegates
public static ADL2_Display_DDCInfo2_Get ADL2_Display_DDCInfo2_Get
{
get
{
if (!ADL2_Display_DDCInfo2_Get_Check && null == ADL2_Display_DDCInfo2_Get_)
{
ADL2_Display_DDCInfo2_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Display_DDCInfo2_Get"))
{
ADL2_Display_DDCInfo2_Get_ = ADLImport.ADL2_Display_DDCInfo2_Get;
}
}
return ADL2_Display_DDCInfo2_Get_;
}
}
/// Private Delegate
private static ADL2_Display_DDCInfo2_Get ADL2_Display_DDCInfo2_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Display_DDCInfo2_Get_Check = false;
#endregion ADL2_Display_DDCInfo2_Get
#region ADL2_Display_DisplayInfo_Get
/// ADL2_Display_DisplayInfo_Get Delegates
public static ADL2_Display_DisplayInfo_Get ADL2_Display_DisplayInfo_Get
{
get
{
if (!ADL2_Display_DisplayInfo_Get_Check && null == ADL2_Display_DisplayInfo_Get_)
{
ADL2_Display_DisplayInfo_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Display_DisplayInfo_Get"))
{
ADL2_Display_DisplayInfo_Get_ = ADLImport.ADL2_Display_DisplayInfo_Get;
}
}
return ADL2_Display_DisplayInfo_Get_;
}
}
/// Private Delegate
private static ADL2_Display_DisplayInfo_Get ADL2_Display_DisplayInfo_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Display_DisplayInfo_Get_Check = false;
#endregion ADL2_Display_DisplayInfo_Get
#region ADL2_Display_DeviceConfig_Get
/// ADL2_Display_DeviceConfig_Get Delegates
public static ADL2_Display_DeviceConfig_Get ADL2_Display_DeviceConfig_Get
{
get
{
if (!ADL2_Display_DeviceConfig_Get_Check && null == ADL2_Display_DeviceConfig_Get_)
{
ADL2_Display_DeviceConfig_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Display_DeviceConfig_Get"))
{
ADL2_Display_DeviceConfig_Get_ = ADLImport.ADL2_Display_DeviceConfig_Get;
}
}
return ADL2_Display_DeviceConfig_Get_;
}
}
/// Private Delegate
private static ADL2_Display_DeviceConfig_Get ADL2_Display_DeviceConfig_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Display_DeviceConfig_Get_Check = false;
#endregion ADL2_Display_DeviceConfig_Get
#region ADL2_Display_HDRState_Get
/// ADL2_Display_HDRState_Get Delegates
public static ADL2_Display_HDRState_Get ADL2_Display_HDRState_Get
{
get
{
if (!ADL2_Display_HDRState_Get_Check && null == ADL2_Display_HDRState_Get_)
{
ADL2_Display_HDRState_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Display_HDRState_Get"))
{
ADL2_Display_HDRState_Get_ = ADLImport.ADL2_Display_HDRState_Get;
}
}
return ADL2_Display_HDRState_Get_;
}
}
/// Private Delegate
private static ADL2_Display_HDRState_Get ADL2_Display_HDRState_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Display_HDRState_Get_Check = false;
#endregion ADL2_Display_HDRState_Get
#region ADL2_Display_Modes_Get
/// ADL2_Display_Modes_Get Delegates
public static ADL2_Display_Modes_Get ADL2_Display_Modes_Get
{
get
{
if (!ADL2_Display_Modes_Get_Check && null == ADL2_Display_Modes_Get_)
{
ADL2_Display_Modes_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Display_Modes_Get"))
{
ADL2_Display_Modes_Get_ = ADLImport.ADL2_Display_Modes_Get;
}
}
return ADL2_Display_Modes_Get_;
}
}
/// Private Delegate
private static ADL2_Display_Modes_Get ADL2_Display_Modes_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Display_Modes_Get_Check = false;
#endregion ADL2_Display_Modes_Get
#region ADL2_Display_Modes_Set
/// ADL2_Display_Modes_Set Delegates
public static ADL2_Display_Modes_Set ADL2_Display_Modes_Set
{
get
{
if (!ADL2_Display_Modes_Set_Check && null == ADL2_Display_Modes_Set_)
{
ADL2_Display_Modes_Set_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Display_Modes_Set"))
{
ADL2_Display_Modes_Set_ = ADLImport.ADL2_Display_Modes_Set;
}
}
return ADL2_Display_Modes_Set_;
}
}
/// Private Delegate
private static ADL2_Display_Modes_Set ADL2_Display_Modes_Set_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Display_Modes_Set_Check = false;
#endregion ADL2_Display_Modes_Set
#region ADL2_Display_DisplayMapConfig_Get
public static ADL2_Display_DisplayMapConfig_Get ADL2_Display_DisplayMapConfig_Get
{
get
{
if (!ADL2_Display_DisplayMapConfig_Get_Check && null == ADL2_Display_DisplayMapConfig_Get_)
{
ADL2_Display_DisplayMapConfig_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Display_DisplayMapConfig_Get"))
{
ADL2_Display_DisplayMapConfig_Get_ = ADLImport.ADL2_Display_DisplayMapConfig_Get;
}
}
return ADL2_Display_DisplayMapConfig_Get_;
}
}
/// Private Delegate
private static ADL2_Display_DisplayMapConfig_Get ADL2_Display_DisplayMapConfig_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Display_DisplayMapConfig_Get_Check = false;
#endregion ADL2_Display_DisplayMapConfig_Get
#region ADL2_Display_DisplayMapConfig_Set
/// ADL2_Display_DisplayMapConfig_Set Delegates
public static ADL2_Display_DisplayMapConfig_Set ADL2_Display_DisplayMapConfig_Set
{
get
{
if (!ADL2_Display_DisplayMapConfig_Set_Check && null == ADL2_Display_DisplayMapConfig_Set_)
{
ADL2_Display_DisplayMapConfig_Set_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Display_DisplayMapConfig_Set"))
{
ADL2_Display_DisplayMapConfig_Set_ = ADLImport.ADL2_Display_DisplayMapConfig_Set;
}
}
return ADL2_Display_DisplayMapConfig_Set_;
}
}
/// Private Delegate
private static ADL2_Display_DisplayMapConfig_Set ADL2_Display_DisplayMapConfig_Set_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Display_DisplayMapConfig_Set_Check = false;
#endregion ADL2_Display_DisplayMapConfig_Set
#region ADL2_Display_DisplayMapConfig_Validate
/// ADL2_Display_DisplayMapConfig_Validate Delegates
public static ADL2_Display_DisplayMapConfig_Validate ADL2_Display_DisplayMapConfig_Validate
{
get
{
if (!ADL2_Display_DisplayMapConfig_Validate_Check && null == ADL2_Display_DisplayMapConfig_Validate_)
{
ADL2_Display_DisplayMapConfig_Validate_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL2_Display_DisplayMapConfig_Validate"))
{
ADL2_Display_DisplayMapConfig_Validate_ = ADLImport.ADL2_Display_DisplayMapConfig_Validate;
}
}
return ADL2_Display_DisplayMapConfig_Validate_;
}
}
/// Private Delegate
private static ADL2_Display_DisplayMapConfig_Validate ADL2_Display_DisplayMapConfig_Validate_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL2_Display_DisplayMapConfig_Validate_Check = false;
#endregion ADL2_Display_DisplayMapConfig_Validate
// ================================
#region ADL_Main_Control_Create
/// ADL_Main_Control_Create Delegates
public static ADL_Main_Control_Create ADL_Main_Control_Create
{
get
{
if (!ADL_Main_Control_Create_Check && null == ADL_Main_Control_Create_)
{
ADL_Main_Control_Create_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL_Main_Control_Create"))
{
ADL_Main_Control_Create_ = ADLImport.ADL_Main_Control_Create;
}
}
return ADL_Main_Control_Create_;
}
}
/// Private Delegate
private static ADL_Main_Control_Create ADL_Main_Control_Create_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL_Main_Control_Create_Check = false;
#endregion ADL_Main_Control_Create
#region ADL_Main_Control_Destroy
/// ADL_Main_Control_Destroy Delegates
public static ADL_Main_Control_Destroy ADL_Main_Control_Destroy
{
get
{
if (!ADL_Main_Control_Destroy_Check && null == ADL_Main_Control_Destroy_)
{
ADL_Main_Control_Destroy_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL_Main_Control_Destroy"))
{
ADL_Main_Control_Destroy_ = ADLImport.ADL_Main_Control_Destroy;
}
}
return ADL_Main_Control_Destroy_;
}
}
/// Private Delegate
private static ADL_Main_Control_Destroy ADL_Main_Control_Destroy_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL_Main_Control_Destroy_Check = false;
#endregion ADL_Main_Control_Destroy
#region ADL_Adapter_NumberOfAdapters_Get
/// ADL_Adapter_NumberOfAdapters_Get Delegates
public static ADL_Adapter_NumberOfAdapters_Get ADL_Adapter_NumberOfAdapters_Get
{
get
{
if (!ADL_Adapter_NumberOfAdapters_Get_Check && null == ADL_Adapter_NumberOfAdapters_Get_)
{
ADL_Adapter_NumberOfAdapters_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL_Adapter_NumberOfAdapters_Get"))
{
ADL_Adapter_NumberOfAdapters_Get_ = ADLImport.ADL_Adapter_NumberOfAdapters_Get;
}
}
return ADL_Adapter_NumberOfAdapters_Get_;
}
}
/// Private Delegate
private static ADL_Adapter_NumberOfAdapters_Get ADL_Adapter_NumberOfAdapters_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL_Adapter_NumberOfAdapters_Get_Check = false;
#endregion ADL_Adapter_NumberOfAdapters_Get
#region ADL_Adapter_ID_Get
/// ADL_Adapter_Active_Get Delegates
public static ADL_Adapter_ID_Get ADL_Adapter_ID_Get
{
get
{
if (!ADL_Adapter_ID_Get_Check && null == ADL_Adapter_ID_Get_)
{
ADL_Adapter_ID_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL_Adapter_ID_Get"))
{
ADL_Adapter_ID_Get_ = ADLImport.ADL_Adapter_ID_Get;
}
}
return ADL_Adapter_ID_Get_;
}
}
/// Private Delegate
private static ADL_Adapter_ID_Get ADL_Adapter_ID_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL_Adapter_ID_Get_Check = false;
#endregion ADL_Adapter_ID_Get
#region ADL_AdapterX2_Caps
/// ADL_AdapterX2_Caps Delegates
public static ADL_AdapterX2_Caps ADL_AdapterX2_Caps
{
get
{
if (!ADL_AdapterX2_Caps_Check && null == ADL_AdapterX2_Caps_)
{
ADL_AdapterX2_Caps_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL_AdapterX2_Caps"))
{
ADL_AdapterX2_Caps_ = ADLImport.ADL_AdapterX2_Caps;
}
}
return ADL_AdapterX2_Caps_;
}
}
/// Private Delegate
private static ADL_AdapterX2_Caps ADL_AdapterX2_Caps_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL_AdapterX2_Caps_Check = false;
#endregion ADL_AdapterX2_Caps
#region ADL_Adapter_AdapterInfo_Get
/// ADL_Adapter_AdapterInfo_Get Delegates
public static ADL_Adapter_AdapterInfo_Get ADL_Adapter_AdapterInfo_Get
{
get
{
if (!ADL_Adapter_AdapterInfo_Get_Check && null == ADL_Adapter_AdapterInfo_Get_)
{
ADL_Adapter_AdapterInfo_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL_Adapter_AdapterInfo_Get"))
{
ADL_Adapter_AdapterInfo_Get_ = ADLImport.ADL_Adapter_AdapterInfo_Get;
}
}
return ADL_Adapter_AdapterInfo_Get_;
}
}
/// Private Delegate
private static ADL_Adapter_AdapterInfo_Get ADL_Adapter_AdapterInfo_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL_Adapter_AdapterInfo_Get_Check = false;
#endregion ADL_Adapter_AdapterInfo_Get
#region ADL_Adapter_Active_Get
/// ADL_Adapter_Active_Get Delegates
public static ADL_Adapter_Active_Get ADL_Adapter_Active_Get
{
get
{
if (!ADL_Adapter_Active_Get_Check && null == ADL_Adapter_Active_Get_)
{
ADL_Adapter_Active_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL_Adapter_Active_Get"))
{
ADL_Adapter_Active_Get_ = ADLImport.ADL_Adapter_Active_Get;
}
}
return ADL_Adapter_Active_Get_;
}
}
/// Private Delegate
private static ADL_Adapter_Active_Get ADL_Adapter_Active_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL_Adapter_Active_Get_Check = false;
#endregion ADL_Adapter_Active_Get
#region ADL_Display_DeviceConfig_Get
/// ADL_Display_DeviceConfig_Get Delegates
public static ADL_Display_DeviceConfig_Get ADL_Display_DeviceConfig_Get
{
get
{
if (!ADL_Display_DeviceConfig_Get_Check && null == ADL_Display_DeviceConfig_Get_)
{
ADL_Display_DeviceConfig_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL_Display_DeviceConfig_Get"))
{
ADL_Display_DeviceConfig_Get_ = ADLImport.ADL_Display_DeviceConfig_Get;
}
}
return ADL_Display_DeviceConfig_Get_;
}
}
/// Private Delegate
private static ADL_Display_DeviceConfig_Get ADL_Display_DeviceConfig_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL_Display_DeviceConfig_Get_Check = false;
#endregion ADL_Display_DeviceConfig_Get
#region ADL_Display_DisplayMapConfig_Get
/// ADL_Display_DisplayMapConfig_Get Delegates
public static ADL_Display_DisplayMapConfig_Get ADL_Display_DisplayMapConfig_Get
{
get
{
if (!ADL_Display_DisplayMapConfig_Get_Check && null == ADL_Display_DisplayMapConfig_Get_)
{
ADL_Display_DisplayMapConfig_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL_Display_DisplayMapConfig_Get"))
{
ADL_Display_DisplayMapConfig_Get_ = ADLImport.ADL_Display_DisplayMapConfig_Get;
}
}
return ADL_Display_DisplayMapConfig_Get_;
}
}
/// Private Delegate
private static ADL_Display_DisplayMapConfig_Get ADL_Display_DisplayMapConfig_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL_Display_DisplayMapConfig_Get_Check = false;
#endregion ADL_Display_DisplayMapConfig_Get
#region ADL_Display_DisplayMapConfig_PossibleAddAndRemove
/// ADL_Display_DisplayMapConfig_PossibleAddAndRemove Delegates
public static ADL_Display_DisplayMapConfig_PossibleAddAndRemove ADL_Display_DisplayMapConfig_PossibleAddAndRemove
{
get
{
if (!ADL_Display_DisplayMapConfig_PossibleAddAndRemove_Check && null == ADL_Display_DisplayMapConfig_PossibleAddAndRemove_)
{
ADL_Display_DisplayMapConfig_PossibleAddAndRemove_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL_Display_DisplayMapConfig_PossibleAddAndRemove"))
{
ADL_Display_DisplayMapConfig_PossibleAddAndRemove_ = ADLImport.ADL_Display_DisplayMapConfig_PossibleAddAndRemove;
}
}
return ADL_Display_DisplayMapConfig_PossibleAddAndRemove_;
}
}
/// Private Delegate
private static ADL_Display_DisplayMapConfig_PossibleAddAndRemove ADL_Display_DisplayMapConfig_PossibleAddAndRemove_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL_Display_DisplayMapConfig_PossibleAddAndRemove_Check = false;
#endregion ADL_Display_DisplayMapConfig_PossibleAddAndRemove
#region ADL_Display_EdidData_Get
/// ADL_Display_EdidData_Get Delegates
public static ADL_Display_EdidData_Get ADL_Display_EdidData_Get
{
get
{
if (!ADL_Display_EdidData_Get_Check && null == ADL_Display_EdidData_Get_)
{
ADL_Display_EdidData_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL_Display_EdidData_Get"))
{
ADL_Display_EdidData_Get_ = ADLImport.ADL_Display_EdidData_Get;
}
}
return ADL_Display_EdidData_Get_;
}
}
/// Private Delegate
private static ADL_Display_EdidData_Get ADL_Display_EdidData_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL_Display_EdidData_Get_Check = false;
#endregion ADL_Display_EdidData_Get
#region ADL_Display_DisplayInfo_Get
/// ADL_Display_DisplayInfo_Get Delegates
public static ADL_Display_DisplayInfo_Get ADL_Display_DisplayInfo_Get
{
get
{
if (!ADL_Display_DisplayInfo_Get_Check && null == ADL_Display_DisplayInfo_Get_)
{
ADL_Display_DisplayInfo_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL_Display_DisplayInfo_Get"))
{
ADL_Display_DisplayInfo_Get_ = ADLImport.ADL_Display_DisplayInfo_Get;
}
}
return ADL_Display_DisplayInfo_Get_;
}
}
/// Private Delegate
private static ADL_Display_DisplayInfo_Get ADL_Display_DisplayInfo_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL_Display_DisplayInfo_Get_Check = false;
#endregion ADL_Display_DisplayInfo_Get
#region ADL_Display_SLSMapConfig_Get
/// ADL_Display_SLSMapConfig_Get Delegates
public static ADL_Display_SLSMapConfig_Get ADL_Display_SLSMapConfig_Get
{
get
{
if (!ADL_Display_SLSMapConfig_Get_Check && null == ADL_Display_SLSMapConfig_Get_)
{
ADL_Display_SLSMapConfig_Get_Check = true;
if (ADLCheckLibrary.IsFunctionValid("ADL_Display_SLSMapConfig_Get"))
{
ADL_Display_SLSMapConfig_Get_ = ADLImport.ADL_Display_SLSMapConfig_Get;
}
}
return ADL_Display_SLSMapConfig_Get_;
}
}
/// Private Delegate
private static ADL_Display_SLSMapConfig_Get ADL_Display_SLSMapConfig_Get_ = null;
/// check flag to indicate the delegate has been checked
private static bool ADL_Display_SLSMapConfig_Get_Check = false;
#endregion ADL_Display_SLSMapConfig_Get
#endregion Export Functions
#region ADL Helper Functions
public static ConvertedDDCInfoFlag ConvertDDCInfoFlag(int DDCInfoValue)
{
ConvertedDDCInfoFlag expandedDDCInfoValue = new ConvertedDDCInfoFlag();
// Indicates the display is a digital device
if ((DDCInfoValue & ADL.ADL_DISPLAYDDCINFOEX_FLAG_DIGITALDEVICE) == ADL.ADL_DISPLAYDDCINFOEX_FLAG_DIGITALDEVICE)
expandedDDCInfoValue.DIGITALDEVICE = true;
// Indicates the display supports EDID queries
if ((DDCInfoValue & ADL.ADL_DISPLAYDDCINFOEX_FLAG_EDIDEXTENSION) == ADL.ADL_DISPLAYDDCINFOEX_FLAG_EDIDEXTENSION)
expandedDDCInfoValue.EDIDEXTENSION = true;
// Indicates the display suports HDMI Audio
if ((DDCInfoValue & ADL.ADL_DISPLAYDDCINFOEX_FLAG_HDMIAUDIODEVICE) == ADL.ADL_DISPLAYDDCINFOEX_FLAG_HDMIAUDIODEVICE)
expandedDDCInfoValue.HDMIAUDIODEVICE = true;
// Indicates the display is a projector
if ((DDCInfoValue & ADL.ADL_DISPLAYDDCINFOEX_FLAG_PROJECTORDEVICE) == ADL.ADL_DISPLAYDDCINFOEX_FLAG_PROJECTORDEVICE)
expandedDDCInfoValue.PROJECTORDEVICE = true;
// Indicates the display supports AI
if ((DDCInfoValue & ADL.ADL_DISPLAYDDCINFOEX_FLAG_SUPPORTS_AI) == ADL.ADL_DISPLAYDDCINFOEX_FLAG_SUPPORTS_AI)
expandedDDCInfoValue.SUPPORTS_AI = true;
// Indicates the display supports YCC601
if ((DDCInfoValue & ADL.ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC601) == ADL.ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC601)
expandedDDCInfoValue.SUPPORT_xvYCC601 = true;
// Indicates the display supports YCC709
if ((DDCInfoValue & ADL.ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC709) == ADL.ADL_DISPLAYDDCINFOEX_FLAG_SUPPORT_xvYCC709)
expandedDDCInfoValue.SUPPORT_xvYCC709 = true;
return expandedDDCInfoValue;
}
public static ConvertedSupportedHDR ConvertSupportedHDR(int supportedHDR)
{
ConvertedSupportedHDR expandedSupportedHDR = new ConvertedSupportedHDR();
// Indicates the display is a digital device
if ((supportedHDR & ADL.ADL_HDR_CEA861_3) == ADL.ADL_HDR_CEA861_3)
expandedSupportedHDR.CEA861_3 = true;
// Indicates the display supports EDID queries
if ((supportedHDR & ADL.ADL_HDR_DOLBYVISION) == ADL.ADL_HDR_DOLBYVISION)
expandedSupportedHDR.DOLBYVISION = true;
// Indicates the display suports HDMI Audio
if ((supportedHDR & ADL.ADL_HDR_FREESYNC_HDR) == ADL.ADL_HDR_FREESYNC_HDR)
expandedSupportedHDR.FREESYNC_HDR = true;
return expandedSupportedHDR;
}
public static ConvertedDisplayInfoValue ConvertDisplayInfoValue(int displayInfoValue)
{
ConvertedDisplayInfoValue expandedDisplayInfoValue = new ConvertedDisplayInfoValue();
// Indicates the display is connected
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED) == ADL.ADL_DISPLAY_DISPLAYINFO_DISPLAYCONNECTED)
expandedDisplayInfoValue.DISPLAYCONNECTED = true;
// Indicates the display is mapped within OS
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED) == ADL.ADL_DISPLAY_DISPLAYINFO_DISPLAYMAPPED)
expandedDisplayInfoValue.DISPLAYMAPPED = true;
// Indicates the display can be forced
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_FORCIBLESUPPORTED) == ADL.ADL_DISPLAY_DISPLAYINFO_FORCIBLESUPPORTED)
expandedDisplayInfoValue.FORCIBLESUPPORTED = true;
// Indicates the display supports genlock
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_GENLOCKSUPPORTED) == ADL.ADL_DISPLAY_DISPLAYINFO_GENLOCKSUPPORTED)
expandedDisplayInfoValue.GENLOCKSUPPORTED = true;
// Indicates the display is an LDA display.
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_LDA_DISPLAY) == ADL.ADL_DISPLAY_DISPLAYINFO_LDA_DISPLAY)
expandedDisplayInfoValue.LDA_DISPLAY = true;
// Indicates the display supports 2x Horizontal stretch
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_2HSTRETCH) == ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_2HSTRETCH)
expandedDisplayInfoValue.MANNER_SUPPORTED_2HSTRETCH = true;
// Indicates the display supports 2x Vertical stretch
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_2VSTRETCH) == ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_2VSTRETCH)
expandedDisplayInfoValue.MANNER_SUPPORTED_2VSTRETCH = true;
// Indicates the display supports cloned desktops
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_CLONE) == ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_CLONE)
expandedDisplayInfoValue.MANNER_SUPPORTED_CLONE = true;
// Indicates the display supports extended desktops
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_EXTENDED) == ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_EXTENDED)
expandedDisplayInfoValue.MANNER_SUPPORTED_EXTENDED = true;
// Indicates the display supports N Stretched on 1 GPU
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_NSTRETCH1GPU) == ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_NSTRETCH1GPU)
expandedDisplayInfoValue.MANNER_SUPPORTED_NSTRETCH1GPU = true;
// Indicates the display supports N Stretched on N GPUs
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_NSTRETCHNGPU) == ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_NSTRETCHNGPU)
expandedDisplayInfoValue.MANNER_SUPPORTED_NSTRETCHNGPU = true;
// Reserved display info flag #2
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_RESERVED2) == ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_RESERVED2)
expandedDisplayInfoValue.MANNER_SUPPORTED_RESERVED2 = true;
// Reserved display info flag #3
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_RESERVED3) == ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_RESERVED3)
expandedDisplayInfoValue.MANNER_SUPPORTED_RESERVED3 = true;
// Indicates the display supports single desktop
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_SINGLE) == ADL.ADL_DISPLAY_DISPLAYINFO_MANNER_SUPPORTED_SINGLE)
expandedDisplayInfoValue.MANNER_SUPPORTED_SINGLE = true;
// Indicates the display supports overriding the mode timing
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_MODETIMING_OVERRIDESSUPPORTED) == ADL.ADL_DISPLAY_DISPLAYINFO_MODETIMING_OVERRIDESSUPPORTED)
expandedDisplayInfoValue.MODETIMING_OVERRIDESSUPPORTED = true;
// Indicates the display supports multi-vpu
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_MULTIVPU_SUPPORTED) == ADL.ADL_DISPLAY_DISPLAYINFO_MULTIVPU_SUPPORTED)
expandedDisplayInfoValue.MULTIVPU_SUPPORTED = true;
// Indicates the display is non-local to this machine
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_NONLOCAL) == ADL.ADL_DISPLAY_DISPLAYINFO_NONLOCAL)
expandedDisplayInfoValue.NONLOCAL = true;
// Indicates the display is a projector
if ((displayInfoValue & ADL.ADL_DISPLAY_DISPLAYINFO_SHOWTYPE_PROJECTOR) == ADL.ADL_DISPLAY_DISPLAYINFO_SHOWTYPE_PROJECTOR)
expandedDisplayInfoValue.SHOWTYPE_PROJECTOR = true;
return expandedDisplayInfoValue;
}
public static ConvertedDisplayModeFlags ConvertDisplayModeFlags(int displayModeFlag)
{
ConvertedDisplayModeFlags expandedDisplayModeFlags = new ConvertedDisplayModeFlags();
// Indicates the display is a digital device
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_COLOURFORMAT_565) == ADL.ADL_DISPLAY_MODE_COLOURFORMAT_565)
expandedDisplayModeFlags.COLOURFORMAT_565 = true;
// Indicates the display supports EDID queries
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_COLOURFORMAT_8888) == ADL.ADL_DISPLAY_MODE_COLOURFORMAT_8888)
expandedDisplayModeFlags.COLOURFORMAT_8888 = true;
// Indicates the display supports normal vertical orientation
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_000) == ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_000)
expandedDisplayModeFlags.ORIENTATION_SUPPORTED_000 = true;
// Indicates the display supports normal vertical orientation
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_090) == ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_090)
expandedDisplayModeFlags.ORIENTATION_SUPPORTED_090 = true;
// Indicates the display supports normal vertical orientation
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_180) == ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_180)
expandedDisplayModeFlags.ORIENTATION_SUPPORTED_180 = true;
// Indicates the display supports normal vertical orientation
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_270) == ADL.ADL_DISPLAY_MODE_ORIENTATION_SUPPORTED_270)
expandedDisplayModeFlags.ORIENTATION_SUPPORTED_270 = true;
// Indicates the display supports normal vertical orientation
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_REFRESHRATE_ROUNDED) == ADL.ADL_DISPLAY_MODE_REFRESHRATE_ROUNDED)
expandedDisplayModeFlags.REFRESHRATE_ROUNDED = true;
// Indicates the display supports normal vertical orientation
if ((displayModeFlag & ADL.ADL_DISPLAY_MODE_REFRESHRATE_ONLY) == ADL.ADL_DISPLAY_MODE_REFRESHRATE_ONLY)
expandedDisplayModeFlags.REFRESHRATE_ONLY = true;
return expandedDisplayModeFlags;
}
public static string ConvertADLReturnValueIntoWords(int adlReturnValue)
{
if (adlReturnValue == ADL.ADL_OK)
return "Success. Function worked as intended.";
if (adlReturnValue == ADL.ADL_ERR)
return "Generic Error.Most likely one or more of the Escape calls to the driver failed!";
if (adlReturnValue == ADL.ADL_ERR_DISABLED_ADAPTER)
return "Call can't be made due to disabled adapter.";
if (adlReturnValue == ADL.ADL_ERR_INVALID_ADL_IDX)
return "Invalid ADL index passed.";
if (adlReturnValue == ADL.ADL_ERR_INVALID_CALLBACK)
return "Invalid Callback passed.";
if (adlReturnValue == ADL.ADL_ERR_INVALID_CONTROLLER_IDX)
return "Invalid controller index passed.";
if (adlReturnValue == ADL.ADL_ERR_INVALID_DISPLAY_IDX)
return "Invalid display index passed.";
if (adlReturnValue == ADL.ADL_ERR_INVALID_PARAM)
return "One of the parameter passed is invalid.";
if (adlReturnValue == ADL.ADL_ERR_INVALID_PARAM_SIZE)
return "One of the parameter size is invalid.";
if (adlReturnValue == ADL.ADL_ERR_NO_XDISPLAY)
return "There's no Linux XDisplay in Linux Console environment.";
if (adlReturnValue == ADL.ADL_ERR_NOT_INIT)
return "ADL not initialized. You need to run ADL_Main_Control_Create.";
if (adlReturnValue == ADL.ADL_ERR_NOT_SUPPORTED)
return "Function not supported by the driver.";
if (adlReturnValue == ADL.ADL_ERR_NULL_POINTER)
return "Null Pointer error.";
if (adlReturnValue == ADL.ADL_ERR_RESOURCE_CONFLICT)
return "Display Resource conflict.";
if (adlReturnValue == ADL.ADL_ERR_SET_INCOMPLETE)
return "Err Set incomplete";
if (adlReturnValue == ADL.ADL_OK_MODE_CHANGE)
return "All OK but need mode change.";
if (adlReturnValue == ADL.ADL_OK_RESTART)
return "All OK, but need to restart.";
if (adlReturnValue == ADL.ADL_OK_WAIT)
return "All OK, but need to wait.";
if (adlReturnValue == ADL.ADL_OK_WARNING)
return "All OK, but with warning..";
// If we get here, then we've got an ADL Return value that we don't understand!
return "ADL Return value not recognised. Your driver is likely newer than this code can understand.";
}
#endregion ADL Helper Functions
}
#endregion ADL Class
}
#endregion ATI.ADL