/* ************************************************************************* *\
INTEL CORPORATION PROPRIETARY INFORMATION
This software is supplied under the terms of a license agreement or
nondisclosure agreement with Intel Corporation and may not be copied or
disclosed except in accordance with the terms of that agreement
Copyright © 2005 Intel Corporation. All Rights Reserved.

File Name: Common.h
Description: Common includes. This is a file shared between Intel & External customers
\* ************************************************************************* */

#ifndef CUISDK_COMMON_H
#define CUISDK_COMMON_H

// EVENT FLAGS
#define IGFX_NULL_EVENT							0x0000
#define IGFX_ROTATION_EVENT						0x0001
#define IGFX_PANEL_FITTING_EVENT				0x0002
#define IGFX_PANNING_EVENT						0x0004
#define IGFX_ALL_EVENTS							IGFX_ROTATION_EVENT | IGFX_PANEL_FITTING_EVENT | IGFX_PANNING_EVENT

/************************************************************
*			 Intel specific error codes						*
*************************************************************/
// Generic Error Codes
#define IGFX_SUCCESS							0x0000
#define IGFX_REGISTRATION_ERROR					0x0001
#define IGFX_INVALID_EVENTHANDLE				0x0002
#define IGFX_INVALID_EVENTMASK					0x0003
#define IGFX_CORRUPT_BUFFER						0x0004
#define IGFX_UNSUPPORTED_GUID					0x0005
#define IGFX_GETCONFIGURATION_ERROR				0x0006
#define IGFX_DEREGISTRATION_ERROR				0x0007
#define IGFX_INVALIDMONITOR_ID					0x0008
#define IGFX_INVALIDCONFIG_FLAG					0x0009
#define IGFX_SETCONFIGATION_ERROR				0x000A

// Error codes for MCCS
#define IGFX_INVALID_MCCS_HANDLE				0x000C
#define IGFX_INVALID_MCCS_CONTROLCODE			0x000D
#define IGFX_INVALID_MCCS_SIZE					0x000E
#define IGFX_MCCS_DRIVER_ERROR					0x000F
#define IGFX_MCCS_DEVICE_ERROR					0x0010
#define IGFX_MCCS_INVALID_MONITOR				0x0011

// Error codes for PowerAPI.
#define IGFX_POWER_API_NOT_SUPPORTED			0x0013
#define IGFX_POWER_API_LOCKED					0x0014
#define IGFX_POWER_API_INVALID_UNLOCK_REQUEST	0x0015
#define IGFX_INVALID_POWER_HANDLE				0x0016
#define IGFX_INVALID_POWER_POLICY				0x0017
#define IGFX_UNSUPPORTED_POWER_POLICY			0x0018
#define IGFX_POWERDEVICE_ERROR					0x0019
#define IGFX_INVALID_DISPLAYID					0x001A

// Error codes for Aspect Scaling
#define IGFX_WRONG_ASPECT_PREFERENCE			0x001B
#define IGFX_INVAILD_OPERATING_MODE				0x001C

// Error codes for Gamma
#define IGFX_INVALID_GAMMA_RAMP					0x001D

// Error codes for TV Connectors
#define IGFX_INVALID_CONNECTOR_SELECTION		0x001E

// Error Code for Get/Set RR RCR
#define IGFX_INVALID_DEVICE_COMBINATION			0x001F
#define IGFX_SETCLONE_FAILED					0x0020
#define IGFX_INVALID_RESOLUTION					0x0021
#define IGFX_INVALID_CONFIGURATION				0x0022

// Error Codes for PWM Frequency
#define IGFX_UNSUPPORTED_INVERTER				0x0023
#define IGFX_BACKLIGHT_PARAMS_INVALID_FREQ		0x0024

// Error Codes for ICUIExternal8
#define IGFX_FAILURE							0x0025

// Error codes for MCCS
#define	IGFX_INVALID_INDEX						0x0026

// Error codes for rotation
#define IGFX_WRONG_ROTATION_PREFERENCE			0x0027

// Error Code for Set Configuration
#define IGFX_INCORRECT_RESOLUTION_FORMAT		0x0028
#define IGFX_INVALID_ORIENTATION_COMBINATION	0x0029
#define IGFX_INVALID_ORIENTATION				0x002A
#define IGFX_INVALID_INPUT						0x002B

/************************************************************
*            Gamma Ramp specific flags						*
*************************************************************/
// Number of elements in each array of gamma ramp
#define MAX_GAMMA_ELEMENTS	256

// Max value of any gamma ramp element
#define MAX_GAMMA_ELEMENT_VALUE	0xFF00

// Max number of elements in each array of the gamma ramp from index 0 that can 
// have value = 0; this is to prevent excessive darkness of the screen
#define DARKNESS_INDEX		50

// Max number of elements in each array of the gamma ramp from index 0 
// that can have max value. This is to prevent excessive brightness
#define BRIGHTNESS_INDEX	175	

// the numbers DARKNESS_INDEX, BRIGHTNESS_INDEX and MAX_GAMMA_ELEMENT_VALUE
// are fixed based on the gamma ramp calculation that is done by
// CUI. In the calculation, after a certain limit, the ramp is clamped.
// also the calulation uses only the higer 8 bits of each element
// and neglect the lower 8 bits. 
/************************************************************
*            Intel specific display types					*
*************************************************************/
#define IGFX_NULL_DEVICE						0x0000
#define IGFX_CRT								0x0001
#define IGFX_LocalFP							0x0002
#define IGFX_ExternalFP							0x0003
#define IGFX_TV									0x0004

/************************************************************
*            TV Connector Specific Flags					*
*************************************************************/
#define IGFX_FORCE_TV					(1<<17) // Same as CUIDEVICE_IGFX_ANY_TV in UserStructs.h

#define IGFX_FLAG_DACMODERGB        (1<<0 )	// SCART
#define IGFX_FLAG_DACMODEYC         (1<<1 )	// SVIDEO
#define IGFX_FLAG_DACMODECOMPOSITE  (1<<2 )	// RCA Composite
#define IGFX_FLAG_DACMODEHDTV       (1<<3 )
#define IGFX_FLAG_DACMODEHDRGB      (1<<4 ) 
#define IGFX_FLAG_DACMODECOMPONENT  (1<<5 )	// Component YPrPb
#define IGFX_FLAG_DACMODEDCONNECTOR IGFX_FLAG_DACMODECOMPONENT // flag for d-connector, same as component
#define IGFX_FLAG_AUTO_CONNECTOR_SELECTION (1<<6)

/************************************************************
*            Get/Set RR Specific Flags/Data Structures		*
*************************************************************/
#define INTERLACED			0x01
#define PROGRESSIVE			0x02
#define MAX_REFRESH_RATE	0x14

typedef struct _RefreshRate
{
	unsigned short usRefRate;
	unsigned short usReserved; // for usScanType Interlaced or progressive
}RefreshRate, *pRefreshRate;

typedef struct _DISPLAY_CONFIG
{
	DWORD uidMonitorPrimary;	// Primary Monitor ID
	DWORD uidMonitorSecondary;	// Secondary Monitor ID
	DWORD XResolution;			// Horizontal Resolution to Set
	DWORD YResolution;			// Vertical Resolution to Set
	DWORD BPP;					// Bits Per Pixel/Color Depth to Set
}Display_Config, *pDisplay_Config;

////////////////////////////////////////////////////////////////////////////////////
//
// Display configuration struct Ver 1.0
//
// GUID Definition - {059D08C1-6475-42aa-BD93-2EAA0ECB241F}
static const GUID IGFX_DISPLAY_CONFIG_GUID_1_0 = 
{ 0x59d08c1, 0x6475, 0x42aa, { 0xbd, 0x93, 0x2e, 0xaa, 0xe, 0xcb, 0x24, 0x1f } };


static const GUID IGFX_DISPLAY_CONFIG_GUID_1_1 = 
{ 0x4ea14ecf, 0x9769, 0x44cc, { 0xbb, 0xa2, 0xdc, 0x5d, 0xa9, 0xfd, 0x50, 0xb6 }};


// Structure definition
typedef struct _IGFX_DISPLAY_CONFIG_1_1
{
	// Filled in by the client/caller
	UINT	nSize;						// Filled in by the caller allocating the structure
	
	// Device identification
	DWORD	uidMonitor;					// Unique ID number for the requested monitor

	// Flags member describing validity of output members
	DWORD	dwFlags;					// Flag bitmask

	// Following methods are returned by the interface

	// Panel fitting related
	LONG	lHorizontalScaling;			// Horizontal scaling: -1, 0, 1
	LONG	lVerticalScaling;			// Vertical scaling: -1, 0, 1
	UINT	ulPhysicalWidth;			// Physical width of display
	UINT	ulPhysicalHeight;			// Physical width of display
	UINT	ulDisplayWidth;				// Resolution X
	UINT	ulDisplayHeight;			// Resolution Y
	
	// Rotation related
	BOOL	bRotationEnabled;			// Rotation Enabled?
	BOOL	bPortraitPolicy;			// Portrait orientation policy
	BOOL	bLandscapePolicy;			// Landscape orientation policy
	DWORD	dwOrientation;				// Orientation of the display

}IGFX_DISPLAY_CONFIG_1_1, *PIGFX_DISPLAY_CONFIG_1_1;

// Definition of values for scaling
#define IGFX_DISPLAY_SCALING_UP		(LONG)1
#define IGFX_DISPLAY_SCALING_NONE	(LONG)0
#define IGFX_DISPLAY_SCALING_DOWN	(LONG)-1

// Definition of values for orientation
#define IGFX_DISPLAY_ORIENTATION_0		0x00
#define IGFX_DISPLAY_ORIENTATION_90		0x01
#define IGFX_DISPLAY_ORIENTATION_180	0x02
#define IGFX_DISPLAY_ORIENTATION_270	0x04

// Definition of dwFlags member
#define IGFX_DISPLAY_CONFIG_FLAG_HORIZONTAL_PANNING		0x0001		// Horizontal panning
#define IGFX_DISPLAY_CONFIG_FLAG_VERTICAL_PANNING		0x0002		// Vertical panning
#define IGFX_DISPLAY_CONFIG_FLAG_HORIZONTAL_SCALING		0x0004		// Horizontal scaling
#define IGFX_DISPLAY_CONFIG_FLAG_VERTICAL_SCALING		0x0008		// Vertical scaling
#define IGFX_DISPLAY_CONFIG_FLAG_PHYSICAL_WIDTH			0x0010		// Physical width
#define IGFX_DISPLAY_CONFIG_FLAG_PHYSICAL_HEIGHT		0x0020		// Physical height
#define IGFX_DISPLAY_CONFIG_FLAG_DISPLAY_WIDTH			0x0040		// Display width
#define IGFX_DISPLAY_CONFIG_FLAG_DISPLAY_HEIGHT			0x0080		// Display height
#define IGFX_DISPLAY_CONFIG_FLAG_ORIENTATION			0x0100		// Orientation
#define IGFX_DISPLAY_CONFIG_FLAG_VIEWPORT				0x0200		// Viewport while panning
#define IGFX_DISPLAY_CONFIG_FLAG_ROTATION				0x0400		// Rotation 
#define IGFX_DISPLAY_CONFIG_FLAG_ROTATION_PORTRAIT		0x0800		// Portrait policy
#define IGFX_DISPLAY_CONFIG_FLAG_ROTATION_LANDSCAPE		0x1000		// Portrait policy


////////////////////////////////////////////////////////////////////////////////////

// Definition of pdwStatus DWORD flag used in EnumAttachableDevices method
#define IGFX_DISPLAY_DEVICE_NOTATTACHED	(0x001)	// No display device currently attached
#define IGFX_DISPLAY_DEVICE_ATTACHED	(0x002)	// Attached
#define IGFX_DISPLAY_DEVICE_OVERRIDE	(0x004)	// Policy indicates Unattached device 
												// will be treated as Attached
#define IGFX_DISPLAY_DEVICE_ACTIVE		(0x010)	// Active device 
#define IGFX_DISPLAY_DEVICE_PRIMARY		(0x100)	// Primary Display Device
#define IGFX_DISPLAY_DEVICE_SECONDARY	(0x200)	// Secondary Display Device


////////////////////////////////////////////////////////////////////////////////////
//
// Device Displays structure Ver 1.0
//

// Interface GUID Definition - {381ECED3-EFF1-4df2-B560-6648E352B18E}, 
//
static const GUID IGFX_DEVICE_DISPLAYS_GUID_1_0 = { 0x381eced3, 0xeff1, 0x4df2, { 0xb5, 0x60, 0x66, 0x48, 0xe3, 0x52, 0xb1, 0x8e } };


#define MAX_MONITORS_PER_ADAPTER			6	// The maximum number of monitors that 
												// can be attached to one Graphics Device

#ifndef ALREADY_DEFINED_IN_IDL

#define ALREADY_DEFINED_IN_IDL

typedef struct DEVICE_DISPLAYS 
{
	UINT	nSize;
	WCHAR	strDeviceName[40]; ;			// Win32 Graphics Device Name 
	DWORD	dwFlags;					// Configuration of the Monitors
	DWORD	uidPrimaryMonitor;			// ID of the Primary Monitor
	UINT 	nMonitors;				// number of elements in the array of ID’s
	DWORD	puidMonitor[MAX_MONITORS_PER_ADAPTER];	// Array of Monitor ID’s attached 
}DEVICE_DISPLAYS, * PDEVICE_DISPLAYS;

#endif // ALREADY_DEFINED_IN_IDL


// Definition of dwFlags in DEVICE_DISPLAYS struct
#define IGFX_DISPLAY_DEVICE_CONFIG_FLAG_SINGLE		(0x1)// Single-Display. Default 
#define IGFX_DISPLAY_DEVICE_CONFIG_FLAG_DDCLONE		(0x3)// Dual-Display Clone
#define IGFX_DISPLAY_DEVICE_CONFIG_FLAG_DDZOOM		(0x4)// Dual-Display Zoom LEGACY
#define IGFX_DISPLAY_DEVICE_CONFIG_FLAG_DDEXTD		(0x5)// Dual-Display Extended Desktop

//Change Begin - Power API.
//Power Conservation Capabilities flags.
#define IGFX_DFGT_SUPPORTED				0x01
#define IGFX_DPST_SUPPORTED				0x02
#define IGFX_ADB_SUPPORTED_AC			0x04
#define IGFX_ADB_SUPPORTED_DC			0x08
#define IGFX_DFGT_AC_SUPPORTED			0x10


// DFGT in DC Mode
//DFGT Structure GUID - {8A2A926D-FF9D-4737-935B-96BF28805B73}
//The following are the various formats of the GUID.

//Registry Format : {8A2A926D-FF9D-4737-935B-96BF28805B73}
//static const GUID IGFX_DFGT_POLICY_GUID_1_0 = { 0x8a2a926d, 0xff9d, 0x4737, { 0x93, 0x5b, 0x96, 0xbf, 0x28, 0x80, 0x5b, 0x73 } };
//DEFINE_GUID(IGFX_DFGT_POLICY_GUID_1_0, 0x8a2a926d, 0xff9d, 0x4737, 0x93, 0x5b, 0x96, 0xbf, 0x28, 0x80, 0x5b, 0x73);
static const GUID IGFX_DFGT_POLICY_GUID_1_0 = { 0x8a2a926d, 0xff9d, 0x4737, { 0x93, 0x5b, 0x96, 0xbf, 0x28, 0x80, 0x5b, 0x73 } };

//Structure Definition for DFGT
typedef struct _IGFX_DFGT_POLICY_1_0
{
	BOOL bEnabled;
}IGFX_DFGT_POLICY_1_0, *PIGFX_DFGT_POLICY_1_0;

// RCR 929546 -- DFGT in AC Mode
// {A119659E-7078-4f5f-B769-AD33668B160D}
static const GUID IGFX_DFGT_POLICY_GUID_1_1 = { 0xa119659e, 0x7078, 0x4f5f, { 0xb7, 0x69, 0xad, 0x33, 0x66, 0x8b, 0x16, 0xd } };

//DPST Structure GUID - {6D24D96F-019C-4baa-ACD5-D48B78050325}
//The following are the various formats of the GUID.

// {6D24D96F-019C-4baa-ACD5-D48B78050325}
//static const GUID IGFX_DPST_POLICY_GUID_1_0 = { 0x6d24d96f, 0x19c, 0x4baa, { 0xac, 0xd5, 0xd4, 0x8b, 0x78, 0x5, 0x3, 0x25 } };
//DEFINE_GUID(IGFX_DPST_POLICY_GUID_1_0, 0x6d24d96f, 0x19c, 0x4baa, 0xac, 0xd5, 0xd4, 0x8b, 0x78, 0x5, 0x3, 0x25);
static const GUID IGFX_DPST_POLICY_GUID_1_0 = { 0x6d24d96f, 0x19c, 0x4baa, { 0xac, 0xd5, 0xd4, 0x8b, 0x78, 0x5, 0x3, 0x25 } };

//Structure Definition for DPST
typedef struct _IGFX_DPST_POLICY_1_0
{
	BOOL  bEnabledDC;
	BOOL  bReserved1; //Reserved for now.
	ULONG ulMaxLevels;
	ULONG ulCurrentAggressivenessDC;
	ULONG ulReserved2; //Reserved for now.
}IGFX_DPST_POLICY_1_0, *PIGFX_DPST_POLICY_1_0;

//ADB Structure GUID - {2B3C5F6C-97B7-4c85-B4F2-335719D24F3D}
//The following are the various formats of the GUID.

//{2B3C5F6C-97B7-4c85-B4F2-335719D24F3D}
//static const GUID IGFX_ADB_POLICY_GUID_1_0 = { 0x2b3c5f6c, 0x97b7, 0x4c85, { 0xb4, 0xf2, 0x33, 0x57, 0x19, 0xd2, 0x4f, 0x3d } };
//DEFINE_GUID(IGFX_ADB_POLICY_GUID_1_0, 0x2b3c5f6c, 0x97b7, 0x4c85, 0xb4, 0xf2, 0x33, 0x57, 0x19, 0xd2, 0x4f, 0x3d);
static const GUID IGFX_ADB_POLICY_GUID_1_0 = { 0x2b3c5f6c, 0x97b7, 0x4c85, { 0xb4, 0xf2, 0x33, 0x57, 0x19, 0xd2, 0x4f, 0x3d } };

//Structure Definition for ADB
typedef struct _IGFX_ADB_POLICY_1_0
{
	BOOL  bEnabledDC;
	BOOL  bEnabledAC; //Reserved for now.
	ULONG ulReserved1;
	ULONG ulReserved2;
	ULONG ulReserved3; //Reserved for now.
}IGFX_ADB_POLICY_1_0, *PIGFX_ADB_POLICY_1_0;

//Policy ID Definitions
#define IGFX_POWER_POLICY_DFGT			0x1
#define IGFX_POWER_POLICY_DPST			0x2
#define IGFX_POWER_POLICY_ADB			0x3
//Change End - Power API.

// Get/Set Gamma Ramp

typedef struct _GAMMARAMP
{
	unsigned short Red[MAX_GAMMA_ELEMENTS];
	unsigned short Green[MAX_GAMMA_ELEMENTS];
	unsigned short Blue[MAX_GAMMA_ELEMENTS];
} GAMMARAMP, *pGAMMARAMP;

typedef struct _COLORSETTINGS
{
	int redGamma, greenGamma, blueGamma;
	int redBrightness, greenBrightness, blueBrightness;
	int redContrast, greenContrast, blueContrast;
} COLORSETTINGS, *pCOLORSETTINGS;

/*** Vista RCR 1892562: SetDeviceData()/GetDeviceData() support for IGFX_DESKTOP_GAMMA START ***/
// {0155F7AC-F8A1-4e64-B2E0-5B58F7821DC3}
static const GUID IGFX_DESKTOP_GAMMA = 
{ 0x155f7ac, 0xf8a1, 0x4e64, { 0xb2, 0xe0, 0x5b, 0x58, 0xf7, 0x82, 0x1d, 0xc3 } };

#define IGFX_REDGAMMA			0x00
#define IGFX_GREENGAMMA			0x01
#define	IGFX_BLUEGAMMA			0x02
#define IGFX_REDBRIGHTNESS		0x03
#define IGFX_GREENBRIGHTNESS	0x04
#define	IGFX_BLUEBRIGHTNESS		0x05
#define IGFX_REDCONTRAST		0x06
#define IGFX_GREENCONTRAST		0x07
#define	IGFX_BLUECONTRAST		0x08

typedef struct
{
	DWORD dwDeviceUID;
	DWORD dwFlags;	// Reserved
	long  lGammaValues[9];
}IGFX_DESKTOP_GAMMA_ARGS, *PIGFX_DESKTOP_GAMMA_ARGS;
/*** Vista RCR 1892562: SetDeviceData()/GetDeviceData() support for IGFX_DESKTOP_GAMMA END ***/

/*** RCR 1892563: SetDeviceData()/GetDeviceData() support for IGFX_GET_SET_MEDIA_COLOR_GUID START ***/
// {41E9B95E-6A77-45ad-A014-F2B4CCE5356A}
static const GUID IGFX_GET_SET_MEDIA_COLOR_GUID = 
{ 0x41e9b95e, 0x6a77, 0x45ad, { 0xa0, 0x14, 0xf2, 0xb4, 0xcc, 0xe5, 0x35, 0x6a } };

#define REGISTRY_CUI_MEDIA_SUBKEY     "Software\\Intel\\Display\\igfxcui\\Media"
#define szProcAmpApplyAlways	_T("ProcAmpApplyAlways")
#define szProcAmpHue			_T("ProcAmpHue")
#define szProcAmpSaturation		_T("ProcAmpSaturation")
#define szProcAmpContrast		_T("ProcAmpContrast")
#define szProcAmpBrightness		_T("ProcAmpBrightness")

typedef struct _IGFX_MEDIA_SETTINGS_DATA
{
    float fValue;    // Current Value
    float fDefault;  // Default Value 
    float fMin;      // Minimium Value 
    float fMax;      // Maximium Value 
    float fStep;     // Adjustment value for each step
}IGFX_MEDIA_SETTINGS_DATA, *PIGFX_MEDIA_SETTINGS_DATA;

typedef struct _IGFX_MEDIA_ENABLE_DATA
{
    BOOL bEnable;		// Current Value
    BOOL bDefault;	// Default Value 
}IGFX_MEDIA_ENABLE_DATA, *PIGFX_MEDIA_ENABLE_DATA;

typedef struct _IGFX_MEDIA_COLOR_DATA
{
	DWORD	dwSupportedFeatures;
	IGFX_MEDIA_ENABLE_DATA	EnableAlways; //Enable Always
	DWORD	dwFlags;		//Reserved
	IGFX_MEDIA_SETTINGS_DATA HueSettings;
	IGFX_MEDIA_SETTINGS_DATA SaturationSettings;
	IGFX_MEDIA_SETTINGS_DATA ContrastSettings;
	IGFX_MEDIA_SETTINGS_DATA BrightnessSettings;	
}IGFX_MEDIA_COLOR_DATA, *PIGFX_MEDIA_COLOR_DATA;
/*** RCR 1892563: SetDeviceData()/GetDeviceData() support for IGFX_GET_SET_MEDIA_COLOR_GUID END***/

/*** Vista RCR 1893046: SetDeviceData()/GetDeviceData() support for IGFX_GET_SET_CONFIGURATION_GUID START***/
// {BC51E8BC-3A25-402e-9D20-4C3FC4E68BF2}
static const GUID IGFX_GET_SET_CONFIGURATION_GUID = 
{ 0xbc51e8bc, 0x3a25, 0x402e, { 0x9d, 0x20, 0x4c, 0x3f, 0xc4, 0xe6, 0x8b, 0xf2 } };

typedef struct _IGFX_DISPLAY_RESOLUTION_EX
{
	DWORD dwHzRes;				// Horizontal Resolution
	DWORD dwVtRes;				// Vertical Resolution
	DWORD dwRR;					// Refresh Rate
	DWORD dwBPP;				// Color Depth
	DWORD dwSupportedStandard;	// Reserved
	DWORD dwPreferredStandard;	// Reserved
	WORD  InterlaceFlag;		// Resreved
}IGFX_DISPLAY_RESOLUTION_EX, *PIGFX_DISPLAY_RESOLUTION_EX;

typedef struct _IGFX_DISPLAY_POSITION
{
	int	iLeft;			// Position - Left		*********************************************************** 
	int	iRight;			// Position - Right		** Position Fields are optional. They are valid only for **
	int	iTop;			// Position - Top		** Secondary Display device in Extended Desktop.		 **
	int	iBottom;		// Position - Bottom	***********************************************************

}IGFX_DISPLAY_POSITION, *PIGFX_DISPLAY_POSITION;

typedef struct _IGFX_DISPLAY_CONFIG_DATA
{     
    DWORD						dwDisplayUID;   // Display Device UID for this display 
	IGFX_DISPLAY_RESOLUTION_EX	Resolution;     // Display Mode for this display
	IGFX_DISPLAY_POSITION		Position;		// Display Position
	DWORD						dwTvStandard;	// Reserved
	BOOL						bIsHDTV;		// Reserved
	DWORD						dwOrientation;	// Display Orientation
	DWORD						dwScaling;		// Reserved	
}IGFX_DISPLAY_CONFIG_DATA, *PIGFX_DISPLAY_CONFIG_DATA;

typedef struct _IGFX_SYSTEM_CONFIG_DATA
{
	DWORD						dwOpMode;	// Operating Mode
	IGFX_DISPLAY_CONFIG_DATA	PriDispCfg;	// Primary Display Device Config Data
	IGFX_DISPLAY_CONFIG_DATA	SecDispCfg;	// Secondary Display Device Config Data
}IGFX_SYSTEM_CONFIG_DATA, *PIGFX_SYSTEM_CONFIG_DATA;

typedef struct 
{ 
    DWORD       dwOperatingMode;
    DWORD       dwPriDevUID; 		//Device on Primary Display( For Single Pipe Simultaneous mode, both devices are here )
    DWORD       dwSecDevUID; 		//Device on Secondary Display
}IGFX_CONFIG_DATA; 

#define MAX_VALID_CONFIG 140

typedef struct 
{ 
    DWORD 				dwNumTotalCfg;		//Total of validation configuration in the following array 
	DWORD				dwReserved1;		// Reserved
	DWORD				dwReserved2;		// Reserved
    IGFX_CONFIG_DATA	ConfigList[MAX_VALID_CONFIG];	//Valid device combinations, upto 7 devices
}IGFX_TEST_CONFIG, *PIGFX_TEST_CONFIG;

/*** Vista RCR 1893046: SetDeviceData()/GetDeviceData() support for IGFX_GET_SET_CONFIGURATION_GUID ENDs***/


// Aspect Scaling Refer igfxcfg\Publics.h and Source\inc\common\dispcomp.h
#define IGFX_CENTERING		0x01
#define IGFX_PANEL_FITTING	0x02
#define IGFX_ASPECT_SCALING	0x04
#define IGFX_SCALING_CUSTOM	0x08

/////////////////// HDTV API STARTS ////////////////

typedef struct
{
    DWORD           dwValue;    //Current Value
    DWORD           dwDefault;  //Default Value 
    DWORD           dwMin;      //Minimium Value 
    DWORD           dwMax;      //Maximium Value 
    DWORD           dwStep;     //Adjustment value for each step
}IGFX_EXTV_DATA, *pIGFX_EXTV_DATA;

typedef  struct { 
	DWORD           dwFlags;
	/* Standard TV parameters */
	DWORD           dwMode;
	DWORD           dwTVStandard;
	DWORD			dwAvailableTVStandard;
	IGFX_EXTV_DATA   PositionX;  
	IGFX_EXTV_DATA   PositionY; 
	IGFX_EXTV_DATA   SizeX; 
	IGFX_EXTV_DATA   SizeY; 
	IGFX_EXTV_DATA   Brightness; 
	IGFX_EXTV_DATA   Contrast; 
	IGFX_EXTV_DATA   Flicker; 
	/* Extended TV parameters */
	IGFX_EXTV_DATA   Sharpness; 
	IGFX_EXTV_DATA   AdaptiveFlicker; 
	IGFX_EXTV_DATA   TwoDFlicker; 
	IGFX_EXTV_DATA   Saturation; 
	IGFX_EXTV_DATA   Hue; 
	IGFX_EXTV_DATA   DotCrawl; 
	IGFX_EXTV_DATA   LumaFilter; 
	IGFX_EXTV_DATA   ChromaFilter;
	DWORD			 dwLetterBox;
}IGFX_TV_PARAMETER_DATA, *pIGFX_TV_PARAMETER_DATA;

//Std TV Data
#define IGFX_FLAG_TV_POSITIONX			(0x01<<0)
#define IGFX_FLAG_TV_POSITIONY			(0x01<<1)
#define IGFX_FLAG_TV_SIZEX				(0x01<<2)
#define IGFX_FLAG_TV_SIZEY				(0x01<<3)
#define IGFX_FLAG_TV_BRIGHTNESS			(0x01<<4)
#define IGFX_FLAG_TV_CONTRAST			(0x01<<5)
#define IGFX_FLAG_TV_FLICKER			(0x01<<6)

//Video Parameter Data
#define IGFX_FLAG_TV_STANDARD			(0x01<<7)
#define IGFX_FLAG_TV_MODE				(0x01<<8)

//Ext TV Data
#define IGFX_FLAG_TV_SHARPNESS         (0x01<<9)
#define IGFX_FLAG_TV_ADAPTIVEFLICKER   (0x01<<10)
#define IGFX_FLAG_TV_TWODFLICKER       (0x01<<11)
#define IGFX_FLAG_TV_SATURATION        (0x01<<12)
#define IGFX_FLAG_TV_HUE               (0x01<<13)
#define IGFX_FLAG_TV_DOTCRAWL          (0x01<<14)
#define IGFX_FLAG_TV_LUMAFILTER        (0x01<<15) 
#define IGFX_FLAG_TV_CHROMAFILTER      (0x01<<16)

//TV Letter Box Status
#define IGFX_FLAG_TV_LETTERBOX    (0x01<<24)
//support for TV Aspect Scaling RCR
#define IGFX_FLAGS_TV_ASPECT_SCALING  (0x01<<25)
//TV Letter Box Status FLAGS
#define IGFX_EXTV_LETTERBOX_ON   (0x01)
#define IGFX_EXTV_LETTERBOX_OFF  (0x01<<1)
//support for TV Aspect Scaling FLAGS
#define IGFX_EXTV_ASPECT_SCALING_4_3       (0x01<<2)
#define IGFX_EXTV_ASPECT_SCALING_16_9      (0x01<<3)



// Standard TV
#define IGFX_TV_STANDARD_NTSC_M   0x0001  //        75 IRE Setup
#define IGFX_TV_STANDARD_NTSC_M_J 0x0002  // Japan,  0 IRE Setup
#define IGFX_TV_STANDARD_PAL_B    0x0004
#define IGFX_TV_STANDARD_PAL_D    0x0008
#define IGFX_TV_STANDARD_PAL_H    0x0010
#define IGFX_TV_STANDARD_PAL_I    0x0020
#define IGFX_TV_STANDARD_PAL_M    0x0040
#define IGFX_TV_STANDARD_PAL_N    0x0080
#define IGFX_TV_STANDARD_SECAM_B  0x0100  
#define IGFX_TV_STANDARD_SECAM_D  0x0200
#define IGFX_TV_STANDARD_SECAM_G  0x0400
#define IGFX_TV_STANDARD_SECAM_H  0x0800
#define IGFX_TV_STANDARD_SECAM_K  0x1000
#define IGFX_TV_STANDARD_SECAM_K1 0x2000
#define IGFX_TV_STANDARD_SECAM_L  0x4000
#define IGFX_TV_STANDARD_WIN_VGA  0x8000	//  VGA graphics
#define IGFX_TV_STANDARD_NTSC_433 0x00010000
#define IGFX_TV_STANDARD_PAL_G    0x00020000
#define IGFX_TV_STANDARD_PAL_60   0x00040000
#define IGFX_TV_STANDARD_SECAM_L1 0x00080000
#define IGFX_TV_STANDARD_PAL_NC   0x00100000	// New Policy

// HDTV standard definition added using the unused upper 12 bits of dwTVStandard
#define IGFX_HDTV_SMPTE_170M_480i59   0x00100000
#define IGFX_HDTV_SMPTE_293M_480p60   0x00200000
#define IGFX_HDTV_SMPTE_293M_480p59   0x00400000
#define IGFX_HDTV_ITURBT601_576i50    0x00800000
#define IGFX_HDTV_ITURBT601_576p50    0x01000000
#define IGFX_HDTV_SMPTE_296M_720p50   0x02000000
#define IGFX_HDTV_SMPTE_296M_720p59   0x04000000
#define IGFX_HDTV_SMPTE_296M_720p60   0x08000000
#define IGFX_HDTV_SMPTE_274M_1080i50  0x10000000
#define IGFX_HDTV_SMPTE_274M_1080i59  0x20000000
#define IGFX_HDTV_SMPTE_274M_1080i60  0x40000000
#define IGFX_HDTV_SMPTE_274M_1080p60  0x80000000

/////////////////// HDTV API ENDS ////////////////

//////////// INVERTER POWER POLICIES END /////////////

// PWM FREQUENCY SET
// {814472D8-36EE-4afd-BAB0-D680EEBB0034}
static const GUID IGFX_POWER_PARAMS_1_0 = { 0x814472d8, 0x36ee, 0x4afd, { 0xba, 0xb0, 0xd6, 0x80, 0xee, 0xbb, 0x0, 0x34 } };

// Policy ID:
#define	IGFX_BACKLIGHT_POLICY	0x1

typedef struct _IGFX_POWER_PARAMS_0
{
    UINT	uiInverterType;
	ULONG	ulInverterFrequency;	//units of Hz
}IGFX_POWER_PARAMS_0, *pIGFX_POWER_PARAMS_0;


// Inverter Types Flags. Keep them same as UserStructs.h
#define	IGFX_INVERTER_I2C     0x01 //INVERTERI2C
#define	IGFX_INVERTER_PWM     0x02 //INVERTER_PWM
#define IGFX_INVERTER_UNKNOWN 0x04 //INVERTER_UNKNOWN

/*
inverterType parameter can be any one of the flags above. Today driver supports get/set 
for only IGFX_INVERTER_PWM

pwmInverterFrequency can be the current Inverter frequency (for Get call) or the frequency 
to set (Set Call)
*/

//////////// INVERTER POWER POLICIES END /////////////

// {CEB7E9C6-00BF-4985-BBF0-917D8FD9BB59}
static const GUID IGFX_CURRENT_CONFIG_1_0 = { 0xceb7e9c6, 0xbf, 0x4985, { 0xbb, 0xf0, 0x91, 0x7d, 0x8f, 0xd9, 0xbb, 0x59 } };

/////////// ICUIEXTERNAL8 START /////////////////////

/****************************************************************************/
//////// DVMT ////////

// {2C70E8A2-70FA-402a-99E6-5D663C629EB8}
static const GUID IGFX_DVMT_GUID_1_0 = { 0x2c70e8a2, 0x70fa, 0x402a, { 0x99, 0xe6, 0x5d, 0x66, 0x3c, 0x62, 0x9e, 0xb8 } };

// Note: This is supported by ICUIExternal8::GetDeviceData only

typedef struct _IGFX_DVMT_1_0
{
	OUT DWORD dwMinDVMTMemory;
	OUT DWORD dwMaxDVMTMemory;
	OUT DWORD dwCurrentUsedDVMTMemory;
	OUT	DWORD dwTotalSystemMemory; // Reserved for Vista
}IGFX_DVMT_1_0, *PIGFX_DVMT_1_0;
//Note: Vista - Does not support Current DVMT; Something called total memory


/****************************************************************************/
//////// OVERLAY ////////

// {EE7D1AA9-872D-40d2-9742-1258F5187B73}
static const GUID IGFX_OVERLAY_GUID_1_0 = { 0xee7d1aa9, 0x872d, 0x40d2, { 0x97, 0x42, 0x12, 0x58, 0xf5, 0x18, 0x7b, 0x73 } };

// Note: This is supported by ICUIExternal8::GetDeviceData only

typedef struct _IGFX_OVERLAY_1_0
{
	OUT BOOL bIsOverlayActive;
}IGFX_OVERLAY_1_0, *PIGFX_OVERLAY_1_0;
//Note: Any WM_DISPLAYCHANGE or DEVICECHANGE, Video Full Screen (ALT+Enter),  causes overlay ON-OFF issue, other than the app start.


/****************************************************************************/
//////// EDID ////////

// {897843AE-998A-4eec-A21E-EA642B4490EC}
static const GUID IGFX_EDID_GUID_1_0 = { 0x897843ae, 0x998a, 0x4eec, { 0xa2, 0x1e, 0xea, 0x64, 0x2b, 0x44, 0x90, 0xec } };

// Note: This is supported by ICUIExternal8::GetDeviceData only

typedef struct _IGFX_EDID_1_0
{
	IN  DWORD dwDisplayDevice;
	OUT DWORD dwEDIDVersion;
	OUT unsigned char EDID_Data[256];
}IGFX_EDID_1_0, *PIGFX_EDID_1_0;


/****************************************************************************/
//////// SCALING ////////

// {69A26315-B0DF-4d66-8FCA-0F164843E79E}
static const GUID IGFX_SCALING_GUID_1_0 = { 0x69a26315, 0xb0df, 0x4d66, { 0x8f, 0xca, 0xf, 0x16, 0x48, 0x43, 0xe7, 0x9e } };

// Note: This is supported by both ICUIExternal8::GetDeviceData and ICUIExternal8::SetDeviceData

// This should be same as CUI_CUSTOM_SCALING
typedef struct _IGFX_CUSTOM_SCALING
{
	DWORD	dwCustomScalingMax;
	DWORD	dwCustomScalingMin;
	DWORD	dwCustomScalingCurrent;
	DWORD	dwCustomScalingStep;
	DWORD	dwCustomScalingDefault;
}IGFX_CUSTOM_SCALING, *PIGFX_CUSTOM_SCALING;

typedef struct _IGFX_DISPLAY_RESOLUTION
{
	DWORD dwHzRes;
	DWORD dwVtRes;
	DWORD dwRR;
	DWORD dwBPP;
}IGFX_DISPLAY_RESOLUTION, *PIGFX_DISPLAY_RESOLUTION;

typedef struct _IGFX_SCALING_1_0
{
	IN  DWORD					dwPrimaryDevice;
	IN  DWORD					dwSecondaryDevice;
	IN  DWORD					dwOperatingMode;
	IN  BOOL					bIsSecondaryDevice; //If secondary device information is required!
	OUT DWORD					dwCurrentAspectOption;
	OUT DWORD					dwSupportedAspectOption;
}IGFX_SCALING_1_0, *PIGFX_SCALING_1_0;

/****************************************************************************/

/****************** MCCS START ************************************/
// {6AB2DFDE-DC65-449c-9714-AA43E3C66158}
static const GUID IGFX_MCCS_GUID_1_0 = { 0x6ab2dfde, 0xdc65, 0x449c, { 0x97, 0x14, 0xaa, 0x43, 0xe3, 0xc6, 0x61, 0x58 } };

#define	MAX_NUM_MCCS_CTLS	0xFF // Same as CUI_MAX_NUM_MCCS_PARAMS UserStructs.h
#define	MAX_NUM_VALUES		0x0F // same as CUI_MAX_NUM_VALUES UserStructs.h
#define	MCCS_OPEN			0x01
#define	MCCS_CLOSE			0x02
#define	MCCS_GET_MAX		0x03
#define	MCCS_GET_MIN		0x04
#define	MCCS_GET_CURRENT	0x05
#define	MCCS_SET_CURRENT	0x06
#define	MCCS_RESET_CONTROL	0x07
#define	MCCS_GET_SUPPORTED	0x08
#define	MCCS_GET_POSSIBLE	0x09

typedef struct _IGFX_MCCS_DATA
{
	IN		DWORD	Cmd;
	IN OUT	UINT	uiHandle;
	IN		DWORD	dwDevice;
	IN		UINT	uiControlCode;
	IN		UINT	uiSize;
	IN		DWORD	dwNCValueIndex;
	IN OUT	DWORD	dwValue;
	OUT		UINT	iNumSupportedControls;
	OUT		UINT	iSupportedControls[MAX_NUM_MCCS_CTLS];
	OUT		UINT	iNCValue[MAX_NUM_VALUES];
}IGFX_MCCS_DATA, *PIGFX_MCCS_DATA;


/****************** MCCS END *********************************************/

/****************** TV Format - New Policy START ************************************/
// {C50130D9-DC02-4f55-A0CD-E824DB8A4772}
static const GUID IGFX_TV_FORMAT_GUID_1_0 = { 0xc50130d9, 0xdc02, 0x4f55, { 0xa0, 0xcd, 0xe8, 0x24, 0xdb, 0x8a, 0x47, 0x72 } };

#define	IGFX_TV_TYPE_STANDARD	0x00
#define	IGFX_TV_TYPE_HDTV		0x01

typedef struct _IGFX_TV_FORMAT_EX
{
	IN		DWORD	dwReserved;
	IN		DWORD	dwDevice;
	IN OUT	DWORD	dwTVStandard;
	IN OUT	DWORD	dwTVType;
	OUT		DWORD	dwAvailableTVStd;
}IGFX_TV_FORMAT_EX, *PIGFX_TV_FORMAT_EX;

/****************** TV Format - New Policy END *********************************************/

/****************** Connector Details START ************************************/
// {2F317ACE-3968-4a57-9667-C6A47B6C4B8C}
static const GUID IGFX_CONNECTOR_STATUS_GUID_1_0 = { 0x2f317ace, 0x3968, 0x4a57, { 0x96, 0x67, 0xc6, 0xa4, 0x7b, 0x6c, 0x4b, 0x8c } };

typedef struct _IGFX_CONNECTOR_STATUS
{
	DWORD dwConnectorSupported;
	DWORD dwConnectorDispAttached;
	DWORD dwConnectorDispActive;
}IGFX_CONNECTOR_STATUS, *PIGFX_CONNECTOR_STATUS;

// make them same as that of Source\inc\common\itvout.h
#define IGFX_CONNECTOR_TYPE_UNKNOWN              0xFFFFFFFF
#define IGFX_CONNECTOR_TYPE_NONE                 0x00000000
#define IGFX_CONNECTOR_TYPE_VGA                  0x00000001 //For CRT 
#define IGFX_CONNECTOR_TYPE_LVDS                 0x00000002	// LFP
#define IGFX_CONNECTOR_TYPE_DVI                  0x00000004	// DFP
#define IGFX_CONNECTOR_TYPE_HDMI                 0x00000008	// HDMI
#define IGFX_CONNECTOR_TYPE_SVIDEO               0x00000010	// TV - SVDIEO
#define IGFX_CONNECTOR_TYPE_COMPOSITE_VIDEO      0x00000020	// TV - COMPOSITE
#define IGFX_CONNECTOR_TYPE_COMPONENT_VIDEO      0x00000040	// TV - COMPONENT
#define IGFX_CONNECTOR_TYPE_DCONNECTOR_VIDEO     0x00000040	// TV - D-CONNECTOR
#define IGFX_CONNECTOR_TYPE_SCART_VIDEO          0x00000080	// TV - SCART

/****************** Connector Details END *********************************************/

/////////// ICUIEXTERNAL8 END /////////////////////

#endif //CUISDK_COMMON_H