/*++ Copyright (c) Microsoft Corporation. All Rights Reserved Module Name: IddCx.h Abstract: Indirect Displays class extension and the client driver interface. Environment: User-mode Driver Framework --*/ #ifndef DXVA2_API_DEFINED #define DXVA2_API_DEFINED #endif #ifndef DO_NOT_USE_DIRECTX_OR_DXVA2 #define DO_NOT_USE_DIRECTX_OR_DXVA2 #endif #include #include #include // // NOTE: This header is generated by stubwork. Please make any // modifications to the corresponding template files // (.x or .y) and use stubwork to regenerate the header // #ifndef _IDDCX_H_ #define _IDDCX_H_ #ifndef WDF_EXTERN_C #ifdef __cplusplus #define WDF_EXTERN_C extern "C" #define WDF_EXTERN_C_START extern "C" { #define WDF_EXTERN_C_END } #else #define WDF_EXTERN_C #define WDF_EXTERN_C_START #define WDF_EXTERN_C_END #endif #endif WDF_EXTERN_C_START #ifndef WDFAPI #error Include WDF.H first #endif // Disable warning 'nonstandard extension used : nameless struct/union' #pragma warning(push) #pragma warning(disable : 4201) // DDI Version model // ----------------- // The interface version model will be based on structure versions, when a DDI call/OS callback needs to be updated // the version of that callback we be incremented along with any structures used, for example if v1 of a call was : // // void SomeDDICall(IDDCX_ADAPTER hOsAdapterContext, IDARG_IN_SOME_DDI* pInArgs); // // and the functionality/params needed to be changed then the following would be added: // // void SomeDDICall2(IDDCX_ADAPTER hOsAdapterContext, IDARG_IN_SOME_DDI2* pInArgs); // // and the DDI function table structure would be updated to IDDCX_DDI2 which would have SomeDDICall replaced with // SomeDDICall2. At the same time a new create interface v2 would be used by a driver // IDDCX Version model // ------------------- // In order for drivers to know precisely which version of IddCx the driver is running the driver can call the // IddCxGetVersion() callback. This helps if IddCx bug that effect behavior are fixed and released within a given OS release, // for example if a IddCx bug was fixed in the Windows 10 Creators Update after release and the driver needed to know if the // IddCx being used had that fix they could use IddCxGetVersion() #define IDDCX_VERSION_RS3 0x1200 #define IDDCX_VERSION_RS4 0x1300 #define IDDCX_VERSION_RS5 0x1380 #define IDDCX_VERSION_19H1 0x1400 #define IDDCX_VERSION_VIBRAINIUM 0x1500 #define IDDCX_VERSION_MANGANESE 0x1600 #define IDDCX_VERSION_IRON 0x1700 #define IDDCX_VERSION_COBALT 0x1800 #define IDDCX_VERSION_COBALT_UPDATEMODE_FIX 0x1801 #define IDDCX_VERSION_LATEST IDDCX_VERSION_COBALT_UPDATEMODE_FIX // Timeout detection and recovery // ------------------------------ // The OS will monitor the drivers processing of frames and if it detects the driver is not making forward progress it will // take action to ensure the desktop is not effected. // The OS will monitor the driver in two ways : // // 1) Ensure that each OS->driver call does not take longer than 10 seconds // 2) Ensure that a driver reports that it has finished process a given frame within 10 seconds, that is that the driver does // not call FinishedProcessingFrame() within 10 seconds of the new frame ready event is triggered // // In the event of a timeout being detected then the OS will call the UMDF BugCheck() call which will cause the UMDF host // process to terminate and restart subject to UMDF device restart policy. /// /// Opaque reference to a WDF indirect display adapter object /// DECLARE_HANDLE(IDDCX_ADAPTER); /// /// Opaque reference to a WDF indirect display monitor object /// DECLARE_HANDLE(IDDCX_MONITOR); /// /// Opaque reference to a WDF indirect display swap-chain object. /// DECLARE_HANDLE(IDDCX_SWAPCHAIN); /// /// Opaque reference to a WDF indirect display OPM output protection context /// DECLARE_HANDLE(IDDCX_OPMCTX); #pragma region Enum Declarations /// /// Enum used to indicates how a given supported feature is implemented /// enum IDDCX_FEATURE_IMPLEMENTATION : UINT { IDDCX_FEATURE_IMPLEMENTATION_UNINITIALIZED = 0, /// /// The feature is not implemented /// IDDCX_FEATURE_IMPLEMENTATION_NONE = 1, /// /// The feature is implemented and hardware is used in the implementation. For example, the adapter /// display pipeline blends the hardware cursor image into the signal sent to the monitor. /// IDDCX_FEATURE_IMPLEMENTATION_HARDWARE = 2, /// /// The feature is implemented and software is used in the implementation. For example, the driver /// support hardware cursor by blending the cursor image into the display pixels as part of the processing. /// IDDCX_FEATURE_IMPLEMENTATION_SOFTWARE = 3, }; /// /// Enum used to indicates the link type for transmission of the video data /// enum IDDCX_TRANSMISSION_TYPE : UINT { IDDCX_TRANSMISSION_TYPE_UNINITIALIZED = 0, /// /// Video data is being transmitted over wired USB /// IDDCX_TRANSMISSION_TYPE_WIRED_USB = 0x1, /// /// Video data is being transmitted over wired Miracast link /// IDDCX_TRANSMISSION_TYPE_WIRED_MIRACAST = 0x2, /// /// Video data is being transmitted over a wired connect not already described /// IDDCX_TRANSMISSION_TYPE_WIRED_OTHER = 0x3, /// /// Video data is being transmitted over wireless MA-USB /// IDDCX_TRANSMISSION_TYPE_WIRELESS_MAUSB = 0x4, /// /// Video data is being transmitted over wireless network not using MA-USB but the device /// is enumerated on the USB bus /// IDDCX_TRANSMISSION_TYPE_WIRELESS_USB_OTHER = 0x5, /// /// Video data is being transmitted over a WiFi wireless network /// IDDCX_TRANSMISSION_TYPE_WIRELESS_WIFI_OTHER = 0x6, /// /// Video data is being transmitted over wireless Miracast link /// IDDCX_TRANSMISSION_TYPE_WIRELESS_MIRACAST = 0x7, /// /// Video data is being transmitted over a non-WiFi wireless network not described above /// IDDCX_TRANSMISSION_TYPE_WIRELESS_OTHER = 0x8, /// /// Video data is being transmitted over TCP/UDP/IP network not described above /// IDDCX_TRANSMISSION_TYPE_NETWORK_OTHER = 0x9, /// /// Video data is being transmitted over a link type that is not covered by the above defines /// IDDCX_TRANSMISSION_TYPE_OTHER = 0xFFFFFFFF, }; /// /// Specifies boolean flags for an indirect display adapter. /// enum IDDCX_ADAPTER_FLAGS : UINT { IDDCX_ADAPTER_FLAGS_NONE = 0, /// /// Indirect display automatically support OS virtual modes, this means mode changes can be /// performed seamlessly by OS using DWM scaling on a per frame basis without any display mode /// change. The disadvantage of this is that when a smaller desktop mode is used by the user the /// desktop image provided to the driver to process will be bigger than the desktop size hence /// wasting some encode and transmit bandwidth. This value is used to indicate to the OS that the /// smallest possible desktop surface size should be used when the desktop mode is changed. /// Typically a solution that has a large processing overhead or limited transmission bandwidth will /// use this flag reduce the desktop image size to process as much as possible.Note setting this flag /// will result in a mode change each time the desktop resolution is changed. /// IDDCX_ADAPTER_FLAGS_USE_SMALLEST_MODE = 1, /// /// Indicates if the driver can utilize move regions provided by the OS in addition to dirty rects when /// encoding the image. The driver should only set this to TRUE if it will use the move regions as it does /// cost additional resource for the OS to generate these. /// If driver sets this to FALSE the OS will convert all move regions in to dirty rects /// IDDCX_ADAPTER_FLAGS_CAN_USE_MOVE_REGIONS = 2, /// /// Indicates if the driver is a remote session driver supporting remote session monitors rather than console /// session monitors. A remote session driver cannot support console session monitors and console session driver /// cannot support remote session monitors. /// IDDCX_ADAPTER_FLAGS_REMOTE_SESSION_DRIVER = 4, /// /// Indicates that the driver perfers physically contiguous memory to be used for swap chain buffers allowing // the driver to directly scan out the buffers and eliminating the need for an intermediate copy. /// IDDCX_ADAPTER_FLAGS_PREFER_PHYSICALLY_CONTIGUOUS = 8, /// /// Indicates that the remote driver wants to receive all cursor position changes rather than just the /// procedural moves. Only valid if IDDCX_ADAPTER_FLAGS_REMOTE_SESSION_DRIVER is set /// IDDCX_ADAPTER_FLAGS_REMOTE_ALL_CURSOR_POSITION = 16, /// /// Indicates that driver prefers more accurate dirty rects even if it costs slightly more CPU usage to track them /// IDDCX_ADAPTER_FLAGS_PREFER_PRECISE_PRESENT_REGIONS = 32, }; DEFINE_ENUM_FLAG_OPERATORS(IDDCX_ADAPTER_FLAGS); /// /// Used to describe the monitor description /// enum IDDCX_MONITOR_DESCRIPTION_TYPE : UINT { IDDCX_MONITOR_DESCRIPTION_TYPE_UNINITIALIZED = 0, /// /// The monitor description is EDID or no EDID description available /// If the monitor has no description then IDDCX_MONITOR_DESCRIPTION_TYPE_EDID shall be used with zero description size /// and null pointer for data /// IDDCX_MONITOR_DESCRIPTION_TYPE_EDID = 1, /// /// For the monitors with DisplayID and EDID /// The monitor description starts with DisplayID followed by EDID without any padding in between /// EDID should contain all available data blocks and shall be present /// The call to connect monitor will fail if DisplayID is missing or invalid, or if EDID is missing /// IDDCX_MONITOR_DESCRIPTION_TYPE_DISPLAYID_AND_EDID = 2, }; /// /// Used to describe a mode the monitor supports based on the monitor description. /// enum IDDCX_MONITOR_MODE_ORIGIN : UINT { IDDCX_MONITOR_MODE_ORIGIN_UNINITIALIZED = 0, /// /// Indicates that the driver added this mode from directly processing the monitor description /// IDDCX_MONITOR_MODE_ORIGIN_MONITORDESCRIPTOR = 1, /// /// Indicates that the driver did not add this mode as a direct resolution of processing the modes /// supported by the monitor but because of separate additional knowledge it has about the monitor /// IDDCX_MONITOR_MODE_ORIGIN_DRIVER = 2, }; /// /// Describes why the driver is calling to update the mode list /// enum IDDCX_UPDATE_REASON : UINT { IDDCX_UPDATE_REASON_UNINITIALIZED = 0, /// /// The mode list is changing due to power constraints on the host system changed /// IDDCX_UPDATE_REASON_POWER_CONSTRAINTS = 1, /// /// The mode list is changing due to changes in bandwidth between the system and the indirect display device /// IDDCX_UPDATE_REASON_HOST_LINK_BANDWIDTH = 2, /// /// The mode list is changing due to changes in bandwidth the indirect display device and the monitor /// IDDCX_UPDATE_REASON_DISPLAY_LINK_BANDWIDTH = 3, /// /// The mode list is changing due to constraints of the product when in a new configuration /// IDDCX_UPDATE_REASON_CONFIGURATION_CONSTRAINTS = 4, /// /// The mode list is changing due to another reason not listed above /// IDDCX_UPDATE_REASON_OTHER = 5, }; enum IDDCX_PATH_FLAGS : UINT { IDDCX_PATH_FLAGS_NONE = 0, /// /// Indicates if this path has changed /// IDDCX_PATH_FLAGS_CHANGED = 1, /// /// Indicates if this path is active /// IDDCX_PATH_FLAGS_ACTIVE = 2, }; /// /// Describes what type of support a driver has for the given Xor cursor format. /// If driver cannot support a particular monochrome Xor or color Xor cursor it can use the /// IDDCX_XOR_CURSOR_SUPPORT_EMULATION value to indicate to the OS that it /// should use it's Xor emulation algorithm to convert the Xor image to alpha cursor and have the /// driver accelerate that. This emulation places a solid border around the cursor image so it /// can be seen in solid color regions of the screen. The advantages of this is that is allows /// the Xor cursor to be hardware accelerated when the adapter cannot support Xor, this is very /// useful on high latency solutions as this typically allows driver to send the cursor information /// over a sideband channel to reduce the latency. The disadvantage is that the user will notice a /// visual difference due to the emulation. The recommendation is not to use this on a low latency /// solution where falling back to software cursor will not impact the mouse latency for the /// user (<50ms) and will result in a better visible experience. On a high latency solution where /// the cursor data can be transmitted independently of the desktop image it is recommended to use /// this flag to allow hardware cursor and hence lower the mouse movement latency. /// enum IDDCX_XOR_CURSOR_SUPPORT : UINT { IDDCX_XOR_CURSOR_SUPPORT_UNINITIALIZED = 0, /// /// Driver does not support this Xor cursor type at all, all cursors of this type will be drawn into the desktop image by /// the OS /// IDDCX_XOR_CURSOR_SUPPORT_NONE = 1, /// /// Driver does support this Xor cursor type /// IDDCX_XOR_CURSOR_SUPPORT_FULL = 2, /// /// The driver does not support this Xor cursor type but driver wants OS to convert the Xor cursor into a alpha cursor, /// see comment above /// IDDCX_XOR_CURSOR_SUPPORT_EMULATION = 3, }; /// /// Describes the type of cursor /// enum IDDCX_CURSOR_SHAPE_TYPE : UINT { IDDCX_CURSOR_SHAPE_TYPE_UNINITIALIZED = 0, /// /// Indicates this is a masked-color cursor shape /// IDDCX_CURSOR_SHAPE_TYPE_MASKED_COLOR = 1, /// /// Indicates this is a 32bpp alpha cursor /// IDDCX_CURSOR_SHAPE_TYPE_ALPHA = 2, }; /// /// Defines the processing status of the frame /// enum IDDCX_FRAME_STATUS : UINT { IDDCX_FRAME_STATUS_UNINITIALIZED = 0, /// /// Indicates that the frame was processed completely and sent to the device /// IDDCX_FRAME_STATUS_COMPLETED = 1, /// /// Indicates that the driver stopped processing this frame to start on a newer frame, this normally /// happens if it is taking a long time to process/transmit the frame /// IDDCX_FRAME_STATUS_DROPPED = 2, /// /// Indicates that the driver stopped processing this frame because driver hit an internal error /// IDDCX_FRAME_STATUS_ERROR = 3, }; /// /// Defines the type of frame processing step /// enum IDDCX_FRAME_STATISTICS_STEP_TYPE : UINT { IDDCX_FRAME_STATISTICS_STEP_TYPE_UNINITIALIZED = 0, /// /// Used to mark the start of a color convert operation /// IDDCX_FRAME_STATISTICS_STEP_TYPE_COLOR_CONVERT_START = 0x1, /// /// Used to mark the end of a color convert operation /// IDDCX_FRAME_STATISTICS_STEP_TYPE_COLOR_CONVERT_END = 0x2, /// /// Used to mark the start of a encode operation /// IDDCX_FRAME_STATISTICS_STEP_TYPE_ENCODE_START = 0x3, /// /// Used to mark the end of a encode operation /// IDDCX_FRAME_STATISTICS_STEP_TYPE_ENCODE_END = 0x4, /// /// Used to mark the start of a encrypt operation /// IDDCX_FRAME_STATISTICS_STEP_TYPE_ENCRYPT_START = 0x5, /// /// Used to mark the end of a encrypt operation /// IDDCX_FRAME_STATISTICS_STEP_TYPE_ENCRYPT_END = 0x6, /// /// Used to mark the start of a mux'ing operation /// IDDCX_FRAME_STATISTICS_STEP_TYPE_MUX_START = 0x7, /// /// Used to mark the end of a mux'ing operation /// IDDCX_FRAME_STATISTICS_STEP_TYPE_MUX_END = 0x8, /// /// Driver defined processing steps points. /// There are 256 single point events defined that the driver can use, each just records a single QPC time /// Valid driver values valid 0x100 - 0x1FF /// IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_1 = 0x100, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_2 = 0x101, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_3 = 0x102, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_4 = 0x103, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_5 = 0x104, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_6 = 0x105, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_7 = 0x106, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_8 = 0x107, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_9 = 0x108, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_10 = 0x109, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_256 = 0x1FF, /// /// Driver defined processing step intervals. /// There are 256 different intervals each with a start and end point defined. /// It is invalid to report either start or end without the other or for the start /// step to have a QPC time after the QPC time in the end step /// Valid start step values are 0x200 - 0x2FFF /// Valid end step values are 0x300 - 0x3FFF /// IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_START_INTERVAL_1 = 0x200, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_END_INTERVAL_1 = 0x300, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_START_INTERVAL_2 = 0x201, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_END_INTERVAL_2 = 0x301, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_START_INTERVAL_3 = 0x202, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_END_INTERVAL_3 = 0x302, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_START_INTERVAL_256 = 0x2FF, IDDCX_FRAME_STATISTICS_STEP_TYPE_DRIVER_DEFINED_END_INTERVAL_256 = 0x3FF, }; enum IDDCX_FRAME_STATISTICS_FLAGS : UINT { IDDCX_FRAME_STATISTICS_FLAGS_NONE = 0, /// /// If set indicates that the driver reduced the color fidelity of the desktop image while processing /// and transmitting this frame /// IDDCX_FRAME_STATISTICS_FLAGS_REDUCED_COLOR_FIDELITY = 1, }; /// /// The type of gamma ramp being set /// enum IDDCX_GAMMARAMP_TYPE : UINT { IDDCX_GAMMARAMP_TYPE_UNINITIALIZED = 0, /// /// The gamma ramp is the default ramp /// IDDCX_GAMMARAMP_TYPE_DEFAULT = 1, /// /// Indicates that the gamma lookup table contains three arrays, one each for the red, green, and blue color channels. /// Each array has 256 16-bit values. /// IDDCX_GAMMARAMP_TYPE_RGB256x3x16 = 2, }; #pragma endregion // Defines the function table used to indirectly call class extension functions. typedef VOID (*PFN_IDD_CX)(VOID); extern PFN_IDD_CX IddFunctions[]; // Forward-declare the driver globals structure, which contains system-defined per-driver data. typedef struct IDD_DRIVER_GLOBALS IDD_DRIVER_GLOBALS, *PIDD_DRIVER_GLOBALS; #include "IddCxFuncEnum.h" #pragma region Forward Declarations // Structures need to be referenced by the event callbacks struct IDD_CX_CLIENT_CONFIG; struct IDDCX_ENDPOINT_VERSION; struct IDDCX_ENDPOINT_DIAGNOSTIC_INFO; struct IDDCX_ADAPTER_CAPS; struct IDARG_IN_ADAPTER_INIT_FINISHED; struct IDARG_IN_ADAPTER_INIT; struct IDARG_OUT_ADAPTER_INIT; struct IDDCX_MONITOR_DESCRIPTION; struct IDDCX_MONITOR_INFO; struct IDARG_IN_MONITORCREATE; struct IDARG_OUT_MONITORCREATE; struct IDARG_OUT_MONITORARRIVAL; struct IDDCX_MONITOR_MODE; struct IDARG_IN_PARSEMONITORDESCRIPTION; struct IDARG_OUT_PARSEMONITORDESCRIPTION; struct IDARG_IN_GETDEFAULTDESCRIPTIONMODES; struct IDARG_OUT_GETDEFAULTDESCRIPTIONMODES; struct IDDCX_TARGET_MODE; struct IDARG_IN_QUERYTARGETMODES; struct IDARG_OUT_QUERYTARGETMODES; struct IDARG_IN_UPDATEMODES; struct IDARG_IN_MAXDISPLAYPIPELINERATE; struct IDDCX_PATH; struct IDARG_IN_COMMITMODES; struct IDDCX_CURSOR_CAPS; struct IDARG_IN_SETUP_HWCURSOR; struct IDDCX_CURSOR_SHAPE_INFO; struct IDARG_IN_QUERY_HWCURSOR; struct IDARG_OUT_QUERY_HWCURSOR; struct IDARG_IN_SETSWAPCHAIN; struct IDDCX_METADATA; struct IDARG_IN_SWAPCHAINSETDEVICE; struct IDARG_OUT_RELEASEANDACQUIREBUFFER; struct IDARG_IN_GETDIRTYRECTS; struct IDARG_OUT_GETDIRTYRECTS; struct IDDCX_MOVEREGION; struct IDARG_IN_GETMOVEREGIONS; struct IDARG_OUT_GETMOVEREGIONS; struct IDDCX_FRAME_STATISTICS_STEP; struct IDDCX_FRAME_STATISTICS; struct IDARG_IN_REPORTFRAMESTATISTICS; struct IDARG_IN_I2C_TRANSMIT; struct IDARG_IN_SET_GAMMARAMP; struct IDARG_IN_I2C_RECEIVE; struct IDARG_IN_OPM_GET_CERTIFICATE_SIZE; struct IDARG_OUT_OPM_GET_CERTIFICATE_SIZE; struct IDARG_IN_OPM_GET_CERTIFICATE; struct IDARG_IN_OPM_CREATE_PROTECTED_OUTPUT; struct IDDCX_OPM_GET_RANDOM_NUMBER; struct IDARG_OUT_OPM_GET_RANDOM_NUMBER; struct IDDCX_OPM_ENCRYPTED_INITIALIZATION_PARAMETERS; struct IDARG_IN_OPM_SET_SIGNING_KEY_AND_SEQUENCE_NUMBERS; struct IDARG_IN_OPM_GET_INFOMATION; struct IDDCX_OPM_GET_INFO_PARAMETERS; struct IDDCX_OPM_REQUESTED_INFORMATION; struct IDARG_OUT_OPM_GET_INFOMATION; struct IDDCX_OPM_CONFIGURE_PARAMETERS; struct IDARG_IN_OPM_CONFIGURE_PROTECTED_OUTPUT; struct IDARG_OUT_GETVERSION; struct IDARG_IN_REPORTCRITICALERROR; struct IDARG_IN_SETSRMLIST; struct IDARG_IN_GETSRMLISTVERSION; struct IDARG_OUT_GETSRMLISTVERSION; struct IDARG_IN_ADAPTERSETRENDERADAPTER; struct IDDCX_DISPLAYCONFIGPATH; struct IDARG_IN_ADAPTERDISPLAYCONFIGUPDATE; struct IDARG_OUT_MONITORGETPHYSICALSIZE; struct IDDCX_SYSTEM_BUFFER_INFO; struct IDARG_OUT_RELEASEANDACQUIRESYSTEMBUFFER; #pragma endregion #pragma region Driver Callback Definitions #pragma region Device Callbacks /// /// Driver DDI function that is called by the OS when an IO control request needs processing by the driver. /// typedef _Function_class_(EVT_IDD_CX_DEVICE_IO_CONTROL) _IRQL_requires_same_ VOID NTAPI EVT_IDD_CX_DEVICE_IO_CONTROL( _In_ WDFDEVICE Device, _In_ WDFREQUEST Request, _In_ size_t OutputBufferLength, _In_ size_t InputBufferLength, _In_ ULONG IoControlCode ); typedef EVT_IDD_CX_DEVICE_IO_CONTROL *PFN_IDD_CX_DEVICE_IO_CONTROL; /// /// A driver DDI function that OS calls to request the driver to parse a monitor description into a list of modes /// the monitor supports /// /// Input arguments of function /// Output arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code typedef _Function_class_(EVT_IDD_CX_PARSE_MONITOR_DESCRIPTION) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_PARSE_MONITOR_DESCRIPTION( _In_ const IDARG_IN_PARSEMONITORDESCRIPTION* pInArgs, _Out_ IDARG_OUT_PARSEMONITORDESCRIPTION* pOutArgs ); typedef EVT_IDD_CX_PARSE_MONITOR_DESCRIPTION *PFN_IDD_CX_PARSE_MONITOR_DESCRIPTION; #pragma endregion #pragma region Adapter Callbacks /// /// A driver DDI that is called by the OS to inform the driver that the adapter initialization has completed. The /// initialization may have failed, so the driver should check the parameters for the adapter status and handle /// failures appropriately (possibly by reporting a device failure). /// typedef _Function_class_(EVT_IDD_CX_ADAPTER_INIT_FINISHED) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_ADAPTER_INIT_FINISHED( _In_ IDDCX_ADAPTER AdapterObject, _In_ const IDARG_IN_ADAPTER_INIT_FINISHED* pInArgs ); typedef EVT_IDD_CX_ADAPTER_INIT_FINISHED *PFN_IDD_CX_ADAPTER_INIT_FINISHED; /// /// A driver DDI that is called by OS to inform the driver of a mode change for monitors on the adapter. /// The OS always provides the IDDCX_PATH for every connected monitor even if it is not active and the OS /// indicates which paths have changed. If a path is marked not active then we expect that whole display pipeline for /// that path to be powered off and no signal is sent to the monitor /// /// NOTE : When a new path is committed the driver should program the display pipeline to display a black /// image until the first frame is ready to be displayed(ie WDDM visibility should be off until /// first frame is ready to be displayed and then the visibility should be turned on). /// /// The handle the driver provides so the OS can reference the adapter when calling the driver /// Input arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code typedef _Function_class_(EVT_IDD_CX_ADAPTER_COMMIT_MODES) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_ADAPTER_COMMIT_MODES( _In_ IDDCX_ADAPTER AdapterObject, _In_ const IDARG_IN_COMMITMODES* pInArgs ); typedef EVT_IDD_CX_ADAPTER_COMMIT_MODES *PFN_IDD_CX_ADAPTER_COMMIT_MODES; #pragma endregion #pragma region Monitor Callbacks /// /// A driver DDI function that OS calls to request the driver provide the default monitor mode list for the /// specified monitor. This DDI is called when a monitor without a description is connected. /// /// The monitor object that is having default modes generated /// Input arguments of function /// Output arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code /// /// The driver must create at least one monitor mode for the monitor description. /// typedef _Function_class_(EVT_IDD_CX_MONITOR_GET_DEFAULT_DESCRIPTION_MODES) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_GET_DEFAULT_DESCRIPTION_MODES( _In_ IDDCX_MONITOR MonitorObject, _In_ const IDARG_IN_GETDEFAULTDESCRIPTIONMODES* pInArgs, _Out_ IDARG_OUT_GETDEFAULTDESCRIPTIONMODES* pOutArgs ); typedef EVT_IDD_CX_MONITOR_GET_DEFAULT_DESCRIPTION_MODES *PFN_IDD_CX_MONITOR_GET_DEFAULT_DESCRIPTION_MODES; /// /// A driver DDI function that OS calls to get a list of target modes supported by the driver for a monitor /// connected to the endpoint. /// /// The monitor object whose modes are being queried /// Input arguments of function /// Output arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code typedef _Function_class_(EVT_IDD_CX_MONITOR_QUERY_TARGET_MODES) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_QUERY_TARGET_MODES( _In_ IDDCX_MONITOR MonitorObject, _In_ const IDARG_IN_QUERYTARGETMODES* pInArgs, _Out_ IDARG_OUT_QUERYTARGETMODES* pOutArgs ); typedef EVT_IDD_CX_MONITOR_QUERY_TARGET_MODES *PFN_IDD_CX_MONITOR_QUERY_TARGET_MODES; /// /// Driver DDI function that is called by OS inform the driver of a mode change for monitors on the adapter. /// /// NOTE : The resolution of the surfaces in the swapchain will always be the same resolution as the target mode set and /// format will be one of the formats supported by the driver but the format of each acquired buffer may /// change frame to frame between the formats supported and the driver should check the format of each buffer acquired. /// /// The handle the driver provides so the OS can reference the adapter when calling the driver /// Input arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code typedef _Function_class_(EVT_IDD_CX_MONITOR_ASSIGN_SWAPCHAIN) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_ASSIGN_SWAPCHAIN( _In_ IDDCX_MONITOR MonitorObject, _In_ const IDARG_IN_SETSWAPCHAIN* pInArgs ); typedef EVT_IDD_CX_MONITOR_ASSIGN_SWAPCHAIN *PFN_IDD_CX_MONITOR_ASSIGN_SWAPCHAIN; /// /// Driver DDI function that is called by OS inform the driver that a swapchain associated with a monitor is not /// valid anymore /// /// The monitor whose swap-chain is no longer valid. /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code typedef _Function_class_(EVT_IDD_CX_MONITOR_UNASSIGN_SWAPCHAIN) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_UNASSIGN_SWAPCHAIN( _In_ IDDCX_MONITOR MonitorObject ); typedef EVT_IDD_CX_MONITOR_UNASSIGN_SWAPCHAIN *PFN_IDD_CX_MONITOR_UNASSIGN_SWAPCHAIN; /// /// Driver DDI function that is called by OS to returns data received from an I2C device in a monitor /// /// A handle to monitor object to send I2C data. /// Input arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code /// /// The data is transmitted to an I2C device in the monitor that is connected to path specified by PathIdx /// I2CTransmitDataToDisplay is responsible for signaling the I2C start condition, sending the I2C address, sending the /// data in the buffer, checking for acknowledgments from the receiver, and signaling the stop condition.For details /// about the I2C bus, see the I2C Bus Specification, published by Philips Semiconductors.The specification defines a /// protocol for initiating I2C communication, reading and writing bytes over the I2C data line, and terminating I2C /// communication. /// /// I2CTransmitDataToDisplay is required to transmit data to an I2C device that has address 0x6E but is permitted to /// refuse to transmit data to any I2C device that has a different address. /// /// I2CTransmitDataToDisplay is permitted to block if another part of the display driver or graphics hardware is using /// the specified monitor's I2C bus. It is also permitted to block if the display driver is using the I2C bus to send or /// receive High-bandwidth Digital Content Protection (HDCP) data. /// /// If the display adapter supports HDCP, the I2CTransmitDataToDisplay function must refuse to send data to an I2C device /// if the device has an I2C address that is used by HDCP. /// /// I2CTransmitDataToDisplay must never transmit data to an I2C device on the display adapter.That is, this function can /// transmit data to an I2C device in a monitor that is connected to the display adapter, but not to an I2C device that /// is on the display adapter itself. /// typedef _Function_class_(EVT_IDD_CX_MONITOR_I2C_TRANSMIT) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_I2C_TRANSMIT( _In_ IDDCX_MONITOR MonitorObject, _In_ const IDARG_IN_I2C_TRANSMIT* pInArgs ); typedef EVT_IDD_CX_MONITOR_I2C_TRANSMIT *PFN_IDD_CX_MONITOR_I2C_TRANSMIT; /// /// Driver DDI function that is called by OS to returns data received from an I2C device in a monitor /// /// A handle to monitor object to receive I2C data from. /// Input arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code /// /// The data is received from an I2C device in the monitor that is connected to path specified by PathIdx /// I2CReceiveDataFromDisplay function is responsible for signaling the I2C start condition, sending the I2C address, /// receiving the data from the I2C device, sending acknowledgments, and signaling the stop condition. /// For details about the I2C bus, see the I2C Bus Specification, published by Philips Semiconductors. /// The specification defines a protocol for initiating I2C communication, reading and writing bytes over the I2C data /// line, and terminating I2C communication. (This resource may not be available in some languages and regions.) /// /// I2CReceiveDataFromDisplay is required to receive data from an I2C device that has address 0x6F but is /// permitted to refuse to receive data from any I2C device that has a different address. /// /// I2CReceiveDataFromDisplay is permitted to block if another part of the display driver or graphics hardware is /// using the specified monitor's I2C bus. It is also permitted to block if the display driver is using the I2C /// bus to send or receive High-bandwidth Digital Content Protection (HDCP) data. /// /// If the display adapter supports HDCP, I2CReceiveDataFromDisplay must refuse to receive data from an I2C device if the /// device has an I2C address that is used by HDCP. /// /// I2CReceiveDataFromDisplay must never receive data from an I2C device on the display adapter.That is, this function /// can receive data from an I2C device in a monitor that is connected to the display adapter, but not from an I2C /// device that is on the display adapter itself. /// typedef _Function_class_(EVT_IDD_CX_MONITOR_I2C_RECEIVE) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_I2C_RECEIVE( _In_ IDDCX_MONITOR MonitorObject, _In_ const IDARG_IN_I2C_RECEIVE* pInArgs ); typedef EVT_IDD_CX_MONITOR_I2C_RECEIVE *PFN_IDD_CX_MONITOR_I2C_RECEIVE; /// /// Driver DDI function that is called by OS to set a gamma ramp on the specified monitor /// /// This is the context for the monitor this gamma call is intended for /// Input arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code /// /// If the driver implements this DDI then this implies the driver support the gamma functionality /// typedef _Function_class_(EVT_IDD_CX_MONITOR_SET_GAMMA_RAMP) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_SET_GAMMA_RAMP( _In_ IDDCX_MONITOR MonitorObject, _In_ const IDARG_IN_SET_GAMMARAMP* pInArgs ); typedef EVT_IDD_CX_MONITOR_SET_GAMMA_RAMP *PFN_IDD_CX_MONITOR_SET_GAMMA_RAMP; /// /// Driver DDI function that is called by OS to get the size of a OPM certificate /// /// This is the context for the adapter this OPM call is intended for /// Input arguments of function /// Output arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code typedef _Function_class_(EVT_IDD_CX_MONITOR_OPM_GET_CERTIFICATE_SIZE) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_OPM_GET_CERTIFICATE_SIZE( _In_ IDDCX_ADAPTER AdapterObject, _In_ const IDARG_IN_OPM_GET_CERTIFICATE_SIZE* pInArgs, _Out_ IDARG_OUT_OPM_GET_CERTIFICATE_SIZE* pOutArgs ); typedef EVT_IDD_CX_MONITOR_OPM_GET_CERTIFICATE_SIZE *PFN_IDD_CX_MONITOR_OPM_GET_CERTIFICATE_SIZE; /// /// Driver DDI function that is called by OS to get a OPM certificate /// /// This is the context for the adapter this OPM call is intended for /// Input arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code typedef _Function_class_(EVT_IDD_CX_MONITOR_OPM_GET_CERTIFICATE) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_OPM_GET_CERTIFICATE( _In_ IDDCX_ADAPTER AdapterObject, _In_ const IDARG_IN_OPM_GET_CERTIFICATE* pInArgs ); typedef EVT_IDD_CX_MONITOR_OPM_GET_CERTIFICATE *PFN_IDD_CX_MONITOR_OPM_GET_CERTIFICATE; /// /// Driver DDI function that is called by OS to create a OPM protected output context /// /// This is the context for the monitor this OPM context should be created on /// This is the context for the OPM context this call is for /// Input arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code typedef _Function_class_(EVT_IDD_CX_MONITOR_OPM_CREATE_PROTECTED_OUTPUT) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_OPM_CREATE_PROTECTED_OUTPUT( _In_ IDDCX_MONITOR MonitorObject, _In_ IDDCX_OPMCTX OpmCxtObject, _In_ const IDARG_IN_OPM_CREATE_PROTECTED_OUTPUT* pInArgs ); typedef EVT_IDD_CX_MONITOR_OPM_CREATE_PROTECTED_OUTPUT *PFN_IDD_CX_MONITOR_OPM_CREATE_PROTECTED_OUTPUT; /// /// Driver DDI function that is called by OS get a OPM random number /// /// This is the context for the OPM context this call is for /// Input arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code typedef _Function_class_(EVT_IDD_CX_MONITOR_OPM_GET_RANDOM_NUMBER) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_OPM_GET_RANDOM_NUMBER( _In_ IDDCX_OPMCTX OpmCxtObject, _Out_ IDARG_OUT_OPM_GET_RANDOM_NUMBER* pOutArgs ); typedef EVT_IDD_CX_MONITOR_OPM_GET_RANDOM_NUMBER *PFN_IDD_CX_MONITOR_OPM_GET_RANDOM_NUMBER; /// /// Driver DDI function that is called by OS to set signing key and sequence number /// /// This is the context for the OPM context this call is for /// Input arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code typedef _Function_class_(EVT_IDD_CX_MONITOR_OPM_SET_SIGNING_KEY_AND_SEQUENCE_NUMBERS) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_OPM_SET_SIGNING_KEY_AND_SEQUENCE_NUMBERS( _In_ IDDCX_OPMCTX OpmCxtObject, _In_ const IDARG_IN_OPM_SET_SIGNING_KEY_AND_SEQUENCE_NUMBERS* pInArgs ); typedef EVT_IDD_CX_MONITOR_OPM_SET_SIGNING_KEY_AND_SEQUENCE_NUMBERS *PFN_IDD_CX_MONITOR_OPM_SET_SIGNING_KEY_AND_SEQUENCE_NUMBERS; /// /// Driver DDI function that is called by OS to get OPM information /// /// This is the context for the OPM context this call is for /// Input arguments of function /// Output arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code typedef _Function_class_(EVT_IDD_CX_MONITOR_OPM_GET_INFOMATION) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_OPM_GET_INFOMATION( _In_ IDDCX_OPMCTX OpmCxtObject, _In_ const IDARG_IN_OPM_GET_INFOMATION* pInArgs, _Out_ IDARG_OUT_OPM_GET_INFOMATION* pOutArgs ); typedef EVT_IDD_CX_MONITOR_OPM_GET_INFOMATION *PFN_IDD_CX_MONITOR_OPM_GET_INFOMATION; /// /// Driver DDI function that is called by OS to configure the protected output /// /// This is the context for the OPM context this call is for /// Input arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code typedef _Function_class_(EVT_IDD_CX_MONITOR_OPM_CONFIGURE_PROTECTED_OUTPUT) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_OPM_CONFIGURE_PROTECTED_OUTPUT( _In_ IDDCX_OPMCTX OpmCxtObject, _In_ const IDARG_IN_OPM_CONFIGURE_PROTECTED_OUTPUT* pInArgs ); typedef EVT_IDD_CX_MONITOR_OPM_CONFIGURE_PROTECTED_OUTPUT *PFN_IDD_CX_MONITOR_OPM_CONFIGURE_PROTECTED_OUTPUT; /// /// Driver DDI function that is called by OS destroy the protected output context /// /// This is the context for the OPM context this call is for /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code typedef _Function_class_(EVT_IDD_CX_MONITOR_OPM_DESTROY_PROTECTED_OUTPUT) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_OPM_DESTROY_PROTECTED_OUTPUT( _In_ IDDCX_OPMCTX OpmCxtObject ); typedef EVT_IDD_CX_MONITOR_OPM_DESTROY_PROTECTED_OUTPUT *PFN_IDD_CX_MONITOR_OPM_DESTROY_PROTECTED_OUTPUT; /// /// A driver DDI function that OS calls to query the physical size of a remote Edid'less monitor /// /// This is the context for the monitor this OPM context should be created on /// Input arguments of function /// /// If the driver knows the physical size of the monitor is should fill in the pOutArgs and return /// STATUS_SUCCESS, in the event the driver does not know the physical size it should /// return STATUS_NO_DATA_DETECTED. /// /// /// This DDI is only called for remote drivers that do not provide a monitor descriptions for the /// specified monitor. If a remote driver does specify a monitor description for a given monitor /// then the physical width and height will be taken from the description and this DDI will not be /// called for that monitor. /// typedef _Function_class_(EVT_IDD_CX_MONITOR_GET_PHYSICAL_SIZE) _IRQL_requires_same_ NTSTATUS NTAPI EVT_IDD_CX_MONITOR_GET_PHYSICAL_SIZE( _In_ IDDCX_MONITOR MonitorObject, _Out_ IDARG_OUT_MONITORGETPHYSICALSIZE* pOutArgs ); typedef EVT_IDD_CX_MONITOR_GET_PHYSICAL_SIZE *PFN_IDD_CX_MONITOR_GET_PHYSICAL_SIZE; #pragma endregion #pragma endregion #pragma region Structure Definitions /// /// Holds per-driver Indirect Display information. Reserved for use by the system. /// typedef struct IDD_DRIVER_GLOBALS { ULONG Reserved; } IDD_DRIVER_GLOBALS, *PIDD_DRIVER_GLOBALS; /// /// Contains information and callbacks for WDFDEVICE intitialization using the Indirect Display class extension. /// struct IDD_CX_CLIENT_CONFIG { /// /// The total size of the structure. /// ULONG Size; PFN_IDD_CX_DEVICE_IO_CONTROL EvtIddCxDeviceIoControl; PFN_IDD_CX_PARSE_MONITOR_DESCRIPTION EvtIddCxParseMonitorDescription; PFN_IDD_CX_ADAPTER_INIT_FINISHED EvtIddCxAdapterInitFinished; PFN_IDD_CX_ADAPTER_COMMIT_MODES EvtIddCxAdapterCommitModes; PFN_IDD_CX_MONITOR_GET_DEFAULT_DESCRIPTION_MODES EvtIddCxMonitorGetDefaultDescriptionModes; PFN_IDD_CX_MONITOR_QUERY_TARGET_MODES EvtIddCxMonitorQueryTargetModes; PFN_IDD_CX_MONITOR_ASSIGN_SWAPCHAIN EvtIddCxMonitorAssignSwapChain; PFN_IDD_CX_MONITOR_UNASSIGN_SWAPCHAIN EvtIddCxMonitorUnassignSwapChain; PFN_IDD_CX_MONITOR_I2C_TRANSMIT EvtIddCxMonitorI2CTransmit; PFN_IDD_CX_MONITOR_I2C_RECEIVE EvtIddCxMonitorI2CReceive; PFN_IDD_CX_MONITOR_SET_GAMMA_RAMP EvtIddCxMonitorSetGammaRamp; PFN_IDD_CX_MONITOR_OPM_GET_CERTIFICATE_SIZE EvtIddCxMonitorOPMGetCertificateSize; PFN_IDD_CX_MONITOR_OPM_GET_CERTIFICATE EvtIddCxMonitorOPMGetCertificate; PFN_IDD_CX_MONITOR_OPM_CREATE_PROTECTED_OUTPUT EvtIddCxMonitorOPMCreateProtectedOutput; PFN_IDD_CX_MONITOR_OPM_GET_RANDOM_NUMBER EvtIddCxMonitorOPMGetRandomNumber; PFN_IDD_CX_MONITOR_OPM_SET_SIGNING_KEY_AND_SEQUENCE_NUMBERS EvtIddCxMonitorOPMSetSigningKeyAndSequenceNumbers; PFN_IDD_CX_MONITOR_OPM_GET_INFOMATION EvtIddCxMonitorOPMGetInformation; PFN_IDD_CX_MONITOR_OPM_CONFIGURE_PROTECTED_OUTPUT EvtIddCxMonitorOPMConfigureProtectedOutput; PFN_IDD_CX_MONITOR_OPM_DESTROY_PROTECTED_OUTPUT EvtIddCxMonitorOPMDestroyProtectedOutput; PFN_IDD_CX_MONITOR_GET_PHYSICAL_SIZE EvtIddCxMonitorGetPhysicalSize; }; /// /// Structure used to describe a version /// struct IDDCX_ENDPOINT_VERSION { /// /// Total size of the structure /// UINT Size; /// /// The major version defined by the driver /// UINT MajorVer; /// /// The minor version defined by the driver /// UINT MinorVer; /// /// The build number defined by the driver /// UINT Build; /// /// The SKU type defined by the driver /// UINT64 SKU; }; /// /// Structure used to provide diagnostics information about an endpoint /// struct IDDCX_ENDPOINT_DIAGNOSTIC_INFO { /// /// Total size of the structure /// UINT Size; /// /// Describes the type of link the video data is being transmitted over /// IDDCX_TRANSMISSION_TYPE TransmissionType; /// /// The friendly name of the endpoint if one exists, this is applicable if the user can give the device /// a name, should be NULL if friendly name does not exist /// PCWSTR pEndPointFriendlyName; /// /// The model name of the endpoint, must be a non - empty string /// PCWSTR pEndPointModelName; /// /// The manufacture name of the endpoint, must be a non - empty string /// PCWSTR pEndPointManufacturerName; /// /// Pointer to version info for the endpoint hardware /// IDDCX_ENDPOINT_VERSION* pHardwareVersion; /// /// Pointer to version info for the endpoint hardware /// IDDCX_ENDPOINT_VERSION* pFirmwareVersion; /// /// Indicates how gamma is implemented /// IDDCX_FEATURE_IMPLEMENTATION GammaSupport; }; /// /// Used to define the capabilities of an adapter /// struct IDDCX_ADAPTER_CAPS { /// /// Total size of the structure /// UINT Size; IDDCX_ADAPTER_FLAGS Flags; /// /// This value represents the total display bandwidth for the adapter, each mode the driver reports to /// the OS also has a display pipeline rate associated with it and the OS will ensure that the combined /// display pipeline rate of all the active modes will never exceed this value. The units the driver uses /// is up to the driver. /// UINT64 MaxDisplayPipelineRate; /// /// Indicates the maximum number of monitors that can be connected at the same time /// UINT MaxMonitorsSupported; /// /// Endpoint diagnostics information, none of this is used for runtime OS decision but used for telemetry /// IDDCX_ENDPOINT_DIAGNOSTIC_INFO EndPointDiagnostics; /// /// The number of frames to request after the desktop goes idle if the driver's encoder requires multiple frames /// to continue improving quality. /// UINT StaticDesktopReencodeFrameCount; }; struct IDARG_IN_ADAPTER_INIT { /// /// The device that will be hosting this WDDM adapter object. /// WDFDEVICE WdfDevice; /// /// [in] Adapter capabilities /// IDDCX_ADAPTER_CAPS* pCaps; /// /// [in, optional] Object attributes that are used to initialize the WDF adapter object. /// PWDF_OBJECT_ATTRIBUTES ObjectAttributes; }; struct IDARG_OUT_ADAPTER_INIT { /// /// [out] Handle to the adapter that the driver can use to identify this adapter when calling OS functions. /// IDDCX_ADAPTER AdapterObject; }; struct IDARG_IN_ADAPTER_INIT_FINISHED { NTSTATUS AdapterInitStatus; }; struct IDDCX_MONITOR_DESCRIPTION { /// /// Total size of the structure /// UINT Size; /// /// Type of this monitor description /// IDDCX_MONITOR_DESCRIPTION_TYPE Type; /// /// The size of the monitor description data /// UINT DataSize; /// /// Pointer to the monitor description data /// Depending on the Type it can be either EDID or DisplayID + EDID /// Reference IDDCX_MONITOR_DESCRIPTION_TYPE for more information /// _Field_size_full_(DataSize) PVOID pData; /// /// If the monitor does not have a description the driver should set DataSize /// to zero and pData to NULL. /// }; /// /// Used to specify information about a monitor /// struct IDDCX_MONITOR_INFO { /// /// Total size of the structure /// UINT Size; /// /// The is the monitor connector type of the monitor /// DISPLAYCONFIG_VIDEO_OUTPUT_TECHNOLOGY MonitorType; /// /// This is a zero based unique identifier for this connector, it should be unique for this adapter and the value should /// not change for this connector across system reboot or driver upgrade. /// The value has to be between 0 and (IDDCX_ADAPTER_CAPS.MaxMonitorsSupported-1) /// UINT ConnectorIndex; /// /// Monitor description for the monitor /// IDDCX_MONITOR_DESCRIPTION MonitorDescription; /// /// Container Id of the monitor being connected, if any device is also inside the monitor (eg audio, touch etc) then /// those device should all have the same container id. /// GUID MonitorContainerId; }; struct IDARG_IN_MONITORCREATE { PWDF_OBJECT_ATTRIBUTES ObjectAttributes; /// /// [in] Pointer to the information about this monitor /// IDDCX_MONITOR_INFO* pMonitorInfo; }; struct IDARG_OUT_MONITORCREATE { /// /// [out] Handle the driver can use to identify this monitor when calling OS functions /// IDDCX_MONITOR MonitorObject; }; struct IDARG_OUT_MONITORARRIVAL { /// /// Luid of the adapter where this monitor is exposed to the OS /// NOTE : There are no API/DDI calls the driver can do with this info it's only use is to pass to companion /// applications so they can identify the monitor they control /// LUID OsAdapterLuid; /// /// DMM VidPn target id of the target this monitor is exposed to the OS /// NOTE : There are no API/DDI calls the driver can do with this info it's only use is to pass to companion /// applications so they can identify the monitor they control /// NOTE : Although this value is related to the IDDCX_MONITOR_INFO.ConnectorIndex passed by the driver /// the OS will perform internal mapping between the two that will change is future release so the driver should not take /// any dependences on this mapping and hence should use OsAdapterLuid & OsTargetId and not IDDCX_MONITOR_INFO.ConnectorIndex /// UINT OsTargetId; }; struct IDDCX_MONITOR_MODE { /// /// Total size of the structure /// UINT Size; /// /// Where the driver derived this mode from /// IDDCX_MONITOR_MODE_ORIGIN Origin; /// /// This is the details of the Monitor mode.Note that AdditionalSignalInfo.vSyncFreqDivider has to have a zero value /// DISPLAYCONFIG_VIDEO_SIGNAL_INFO MonitorVideoSignalInfo; }; struct IDARG_IN_PARSEMONITORDESCRIPTION { /// /// [in] Monitor description the driver should decode /// IDDCX_MONITOR_DESCRIPTION MonitorDescription; /// /// [in] The number of monitor modes the pMonitorModes buffer being passed into the driver can hold. /// A value of zero indicates that the driver should not copy the monitor mode list /// into the provide buffer but should set the output buffer size to the size required /// UINT MonitorModeBufferInputCount; /// /// [out] Pointer to buffer that driver should copy the monitor modes to if the value is non-NULL. /// If value is NULL then driver should not copy any data and should just set the value /// IDARG_OUT_PARSEMONITORDESCRIPTION.MonitorModeBufferOutputCount to indicate the size of buffer /// required to store the modes /// _Field_size_opt_(MonitorModeBufferInputCount) IDDCX_MONITOR_MODE* pMonitorModes; }; #define NO_PREFERRED_MODE 0xffffffff struct IDARG_OUT_PARSEMONITORDESCRIPTION { /// /// [out] If IDARG_IN_PARSEMONITORDESCRIPTION.pMonitorModes was NULL then driver should /// set this to the number of monitor modes the driver would generate for the specified monitor /// description. /// If IDARG_IN_PARSEMONITORDESCRIPTION.pMonitorModes was non-NULL then this is the count of the /// monitor modes that the driver copied to that buffer /// UINT MonitorModeBufferOutputCount; /// /// [out] Index into the pMonitorModes array of the preferred mode monitor mode, a value of NO_PREFERRED_MODE /// indicates that there is no preferred monitor mode /// UINT PreferredMonitorModeIdx; }; struct IDARG_IN_GETDEFAULTDESCRIPTIONMODES { /// /// [in] The number of monitor modes the pDefaultsMonitorModes buffer being passed into the driver can hold. /// A value of zero indicates that the driver should not copy the monitor mode list /// into the provide buffer but should set the output buffer size to the size required /// UINT DefaultMonitorModeBufferInputCount; /// /// [out] Pointer to buffer that driver should copy the monitor modes to if the value is non-NULL. /// If value is NULL then driver should not copy any data and should just set the value /// IDARG_OUT_GETDEFAULTDESCRIPTIONMODES.DefaultMonitorModeBufferOutputCount to indicate the size of buffer /// required to store the modes /// _Field_size_opt_(DefaultMonitorModeBufferInputCount) IDDCX_MONITOR_MODE* pDefaultMonitorModes; }; struct IDARG_OUT_GETDEFAULTDESCRIPTIONMODES { /// /// [out] If IDARG_IN_PARSEMONITORDESCRIPTION.pDefaultMonitorModes was NULL then driver should /// set this to the number of monitor modes the driver would generate for the specified monitor /// description. /// If IDARG_IN_PARSEMONITORDESCRIPTION.pDefaultMonitorModes was non-NULL then this is the count of the /// monitor modes that the driver copied to that buffer /// UINT DefaultMonitorModeBufferOutputCount; /// /// [out] Index into the pMonitorModes array of the preferred mode monitor mode, a value of NO_PREFERRED_MODE /// indicates that there is no preferred monitor mode /// UINT PreferredMonitorModeIdx; }; /// /// Used to describe a target mode /// struct IDDCX_TARGET_MODE { /// /// Total size of the structure /// UINT Size; /// /// This is the details of the target mode.Note that AdditionalSignalInfo.vSyncFreqDivider has to have a zero value /// NOTE : DISPLAYCONFIG_VIDEO_SIGNAL_INFO.vSyncFreq is the Vsync rate between the Indirect Display device and the /// connected monitor. DISPLAYCONFIG_VIDEO_SIGNAL_INFO.AdditionalSignalInfo.vSyncFreqDivider is used to /// calculate the rate at which the OS will update the desktop image. /// The desktop update rate will calculate be : /// DISPLAYCONFIG_VIDEO_SIGNAL_INFO.vSyncFreq / DISPLAYCONFIG_VIDEO_SIGNAL_INFO.AdditionalSignalInfo.vSyncFreqDivider /// DISPLAYCONFIG_VIDEO_SIGNAL_INFO.AdditionalSignalInfo.vSyncFreqDivider cannot be zero /// DISPLAYCONFIG_TARGET_MODE TargetVideoSignalInfo; /// /// This is the display pipeline bandwidth required for this mode. /// UINT64 RequiredBandwidth; }; struct IDARG_IN_QUERYTARGETMODES { /// /// [in] The monitor description, note this may not be the monitor description the driver originally /// provided in the monitor arrival call, the driver needs to use this monitor description /// when processing this DDI. This allows for monitor description to be updated by OS. /// IDDCX_MONITOR_DESCRIPTION MonitorDescription; /// /// [in] The number of target modes the pTargetModes buffer be passed to the driver can hold. /// If the value is zero then the driver should not copy the target mode list to pTargetModes /// UINT TargetModeBufferInputCount; /// /// [out] Pointer to buffer driver should copy the target modes it supports for this monitor /// _Field_size_(TargetModeBufferInputCount) IDDCX_TARGET_MODE* pTargetModes; }; struct IDARG_OUT_QUERYTARGETMODES { /// /// [out] Driver should set this to the number of target modes the driver copied to the buffer /// if the OS provided one otherwise the number of target modes it would have copied if the OS /// had provided a buffer /// UINT TargetModeBufferOutputCount; }; struct IDARG_IN_UPDATEMODES { /// /// Indicates the reason why the driver is updating the modes /// IDDCX_UPDATE_REASON Reason; /// /// [in] Number of target modes in the pTargetModes buffer. This cannot be zero /// UINT TargetModeCount; /// /// [in] Pointer to buffer driver should copy the target modes it supports for this monitor /// _Field_size_(TargetModeCount) IDDCX_TARGET_MODE* pTargetModes; }; struct IDARG_IN_MAXDISPLAYPIPELINERATE { /// /// Indicates the reason why the driver is updating the rate /// IDDCX_UPDATE_REASON Reason; /// /// This is the new value for IDDCX_ADAPTER_CAPS.MaxDisplayPipelineRate /// UINT64 MaxDisplayPipelineRate; }; /// /// Used to describe the mode that should be set on a given monitor /// struct IDDCX_PATH { /// /// Total size of the structure /// UINT Size; /// /// The handle the driver provides to identify the monitor this path is targeted at /// IDDCX_MONITOR MonitorObject; /// /// Contains flags for this path, like the path's active state and whether it changed. /// IDDCX_PATH_FLAGS Flags; /// /// This is the details of the target mode.Note that AdditionalSignalInfo.vSyncFreqDivider has to have a zero value /// NOTE : DISPLAYCONFIG_VIDEO_SIGNAL_INFO.vSyncFreq is the Vsync rate between the Indirect Display device and the /// connected monitor. DISPLAYCONFIG_VIDEO_SIGNAL_INFO.AdditionalSignalInfo.vSyncFreqDivider is used to /// calculate the rate at which the OS will update the desktop image. /// The desktop update rate will calculate be : /// DISPLAYCONFIG_VIDEO_SIGNAL_INFO.vSyncFreq / DISPLAYCONFIG_VIDEO_SIGNAL_INFO.AdditionalSignalInfo.vSyncFreqDivider /// DISPLAYCONFIG_VIDEO_SIGNAL_INFO.AdditionalSignalInfo.vSyncFreqDivider cannot be zero /// DISPLAYCONFIG_VIDEO_SIGNAL_INFO TargetVideoSignalInfo; }; struct IDARG_IN_COMMITMODES { /// /// [in] The number of paths in the pPaths array /// UINT PathCount; /// /// [in] Point to the array of paths to be committed /// _Field_size_(PathCount) IDDCX_PATH* pPaths; }; /// /// Structure used to describe the cursor capabilities for a given path. /// struct IDDCX_CURSOR_CAPS { /// /// Total size of the structure /// UINT Size; /// /// Indicates what level of support the driver has for XOR masks in the 32-bit masked color cursor format. /// NOTE : The OS will first convert any monochrome cursor to a color mask cursor. /// IDDCX_XOR_CURSOR_SUPPORT ColorXorCursorSupport; /// /// Indicates if the adapter supports the 32-bit alpha cursor format. Most cursors are alpha format. /// BOOL AlphaCursorSupport; /// /// The maximum width supported for all supported cursor types /// UINT MaxX; /// /// The maximum height support for all cursor types /// UINT MaxY; }; struct IDARG_IN_SETUP_HWCURSOR { /// /// [in] Cursor information for this path /// IDDCX_CURSOR_CAPS CursorInfo; /// /// [in] An event handle that will be triggered when new cursor data is available /// HANDLE hNewCursorDataAvailable; }; /// /// Describes the cursor shape /// struct IDDCX_CURSOR_SHAPE_INFO { /// /// Total size of the structure /// UINT Size; /// /// Unique id for the current cursor image, this is incremented each time a cursor image is set (even if that image has been set before). /// This is used to check if the current cursor image the driver has cached has changed and cannot be used in any way to allow caching /// for animated cursor sequences. /// UINT ShapeId; /// /// Indicates the type of cursor data written to the cursor shape buffer /// IDDCX_CURSOR_SHAPE_TYPE CursorType; /// /// Width in pixels of the cursor shape written to the shape buffer /// UINT Width; /// /// Height in pixels of the cursor shape written to the shape buffer /// UINT Height; /// /// Pitch in bytes of the cursor shape written to the shape buffer /// UINT Pitch; /// /// X position of the cursor hotspot relative to the top-left of the cursor /// UINT XHot; /// /// Y position of the cursor hotspot relative to the top-left of the cursor /// UINT YHot; }; struct IDARG_IN_QUERY_HWCURSOR { /// /// [in] The shape id of the last cursor shape the driver received for this monitor, this is compared against the /// latest shape the OS has and the new shape is only copied to the buffer it OS version has been updated since /// last image driver received /// DWORD LastShapeId; /// /// [in] Size of the cursor shape buffer pShapeBuffer /// UINT ShapeBufferSizeInBytes; /// /// [out] Buffer provided by driver that the OS will copy any new cursor image data into /// _Field_size_bytes_(ShapeBufferSizeInBytes) PBYTE pShapeBuffer; }; struct IDARG_OUT_QUERY_HWCURSOR { /// /// [out] Indicates if the cursor is visible or not. /// BOOL IsCursorVisible; /// /// [out] If the cursor is visible then this is the screen co-ordinates of the top-left hand pixel in the cursor image. /// NOTE : This can be negative eg hot-spot in center of cursor and is placed in top-left of screen /// INT X; /// /// [out] If the cursor is visible then this is the screen co-ordinates of the top-left hand pixel in the cursor image. /// NOTE : This can be negative eg hot-spot in center of cursor and is placed in top-left of screen /// INT Y; /// /// [out] Indicates if the cursor shape has been updated since the last time the driver called, if it has been updated /// then the OS updated the CursorShapeInfo structure and also copied the new cursor image data into the /// IDARG_IN_QUERY_HWCURSOR.pShapeBuffer buffer /// BOOL IsCursorShapeUpdated; /// /// [out] If cursor visible then OS will copy the current cursor info into this buffer, if cursor is not visible then /// OS will zero this structure /// IDDCX_CURSOR_SHAPE_INFO CursorShapeInfo; }; struct IDARG_OUT_QUERY_HWCURSOR2 { /// /// [out] Indicates if the cursor is visible or not. /// BOOL IsCursorVisible; /// /// [out] If the cursor is visible then this is the screen co-ordinates of the top-left hand pixel in the cursor image. /// Only valid if PositionValid is TRUE /// NOTE : This can be negative eg hot-spot in center of cursor and is placed in top-left of screen /// INT X; /// /// [out] If the cursor is visible then this is the screen co-ordinates of the top-left hand pixel in the cursor image. /// Only valid if PositionValid is TRUE /// NOTE : This can be negative eg hot-spot in center of cursor and is placed in top-left of screen /// INT Y; /// /// [out] Indicates if the cursor shape has been updated since the last time the driver called, if it has been updated /// then the OS updated the CursorShapeInfo structure and also copied the new cursor image data into the /// IDARG_IN_QUERY_HWCURSOR.pShapeBuffer buffer /// BOOL IsCursorShapeUpdated; /// /// [out] If cursor visible then OS will copy the current cursor info into this buffer, if cursor is not visible then /// OS will zero this structure /// IDDCX_CURSOR_SHAPE_INFO CursorShapeInfo; /// /// [out] Indicates if the X, Y and PositionId fields in this structure are valid or not /// BOOL PositionValid; /// /// [out] The position id of the last cursor position that the OS received for this monitor, the driver can /// compare this to the last cursor position that it processed to know it should process a new position update. /// Note that there are cases where the position values may not changed but position id value has changed, in this /// case the driver should process the position as if it was a new move. /// PositionId is not updated if IsCursorVisible changes /// Only valid if PositionValid is TRUE /// UINT PositionId; }; struct IDARG_IN_SETSWAPCHAIN { /// /// [in] Handle to indirect swapchain that will be used to pass the desktop image to the driver /// for processing, transmission and display /// IDDCX_SWAPCHAIN hSwapChain; /// /// [in] Handle to auto reset event that is signaled when new image to encode is ready /// HANDLE hNextSurfaceAvailable; /// /// [In] Luid of the adapter were the desktop image was rendered /// LUID RenderAdapterLuid; }; /// /// Per frame meta-data /// struct IDDCX_METADATA { /// /// Total size of the structure /// UINT Size; /// /// Presentation frame number of this surface, if the frame number is the same as the previous frame then /// that indicates that there has not been any image updates from the previous frame and is an opportunity /// for the driver to re-encode the desktop image again to increase the visual quality. /// Once there are no more updates the OS will present the same frame IDDCX_ADAPTER_CAPS.StaticDesktopReencodeFrameCount /// times (a presentation internals) and then stop presenting until the next update /// UINT PresentationFrameNumber; /// /// Number of dirty rects for this frame, call GetDirtyRects() to get the dirty rects /// NOTE : A zero DirtyRectCount and MoveRegionCount value indicates there were no desktop updates and the /// PresentationFrameNumber is the same as last frame /// UINT DirtyRectCount; /// /// Number of move regions in this frame, call GetMoveRegions() to get the move regions /// NOTE : A zero DirtyRectCount and MoveRegionCount value indicates there were no desktop updates and the /// PresentationFrameNumber is the same as last frame /// UINT MoveRegionCount; /// /// Indicates if the provided surface is hardware protected or not /// BOOL HwProtectedSurface; /// /// System QPC time of when this surface should be displayed on the indirect display monitor /// UINT64 PresentDisplayQPCTime; /// /// DX surface that contains the image to encode and transmit. /// The driver can use this DX surface anytime until ReleaseAndAcquire is called again /// NOTE : This surface is always a A8R8G8B8 formated surface /// IDXGIResource* pSurface; }; struct IDARG_IN_SWAPCHAINSETDEVICE { /// /// The DXGI device used to process swap-chain frames. /// IDXGIDevice* pDevice; }; struct IDARG_OUT_RELEASEANDACQUIREBUFFER { /// /// [out] Per-frame metadata and frame information /// IDDCX_METADATA MetaData; }; struct IDARG_IN_GETDIRTYRECTS { /// /// [in] Number of dirty rects in the pDirtyRects array /// UINT DirtyRectInCount; /// /// [out] Pointer to the buffer where the OS can copy the dirty rects that indicate which parts of the surface have been /// changed since the last present. /// _Field_size_full_(DirtyRectInCount) RECT* pDirtyRects; }; struct IDARG_OUT_GETDIRTYRECTS { /// /// [out] Number of dirty rects the OS copied into the pDirtyRects array /// UINT DirtyRectOutCount; }; /// /// Describes a move region within a surface /// struct IDDCX_MOVEREGION { /// /// Total size of the structure /// UINT Size; /// /// The location within the surface of the top left of the source rect, the source rect size is the same as the /// destination rect size /// POINT SourcePoint; /// /// Defines the destination rect of the move /// RECT DestRect; }; struct IDARG_IN_GETMOVEREGIONS { /// /// [in] Number of move regions in the pMoveRegions array /// UINT MoveRegionInCount; /// /// [out] Pointer to the buffer where the OS can copy the move regions /// _Field_size_full_(MoveRegionInCount) IDDCX_MOVEREGION* pMoveRegions; }; struct IDARG_OUT_GETMOVEREGIONS { /// /// [out] Number of move regions the OS copied into the pMoveRegions array /// UINT MoveRegionOutCount; }; /// /// Defines a single step of the frame processing /// struct IDDCX_FRAME_STATISTICS_STEP { /// /// Total size of the structure /// UINT Size; /// /// The type of frame processing step /// IDDCX_FRAME_STATISTICS_STEP_TYPE Type; /// /// Provides the system QPC time of the step /// UINT64 QpcTime; /// /// When driver defined processing part is used then driver can store additional data here /// UINT32 Data[2]; }; /// /// Holds the frame processing statics for a whole frame /// struct IDDCX_FRAME_STATISTICS { /// /// Total size of the structure /// UINT Size; /// /// The frame number provided in the ReleaseAndAcquireBuffer call /// UINT PresentationFrameNumber; /// /// Indicates the overall status of processing this frame /// IDDCX_FRAME_STATUS FrameStatus; /// /// Zero based number to indicates the number of times the same frame has been encoded and sent. /// Re-encodes can be the result of the OS providing the sane frame (and frame number) to the driver to /// encode or the driver having to re-encode outside of the normal OS presentation to satisfy the /// protocol /// UINT ReEncodeNumber; /// /// Indicates the number of slices the driver processes the frame in, if slices are not used /// then this should be set to the value one /// UINT FrameSliceTotal; /// /// Indicates the zero based slice number being reported, if slicing is not supported then the driver /// should always set this to the value zero /// UINT CurrentSlice; /// /// System Qpc time the driver acquired the buffer from the OS /// UINT64 FrameAcquireQpcTime; /// /// The size of the frame step array pointed to by pFrameParts /// UINT FrameProcessingStepsCount; /// /// Array of frame processing steps the driver performed /// _Field_size_(FrameProcessingStepsCount) IDDCX_FRAME_STATISTICS_STEP* pFrameProcessingStep; /// /// Marks the time when the driver started transmission for this slice to the device /// NOTE : This marks the time the driver started calling the transmit API's not when the data actually starts being transmitted /// UINT64 SendStartQpcTime; /// /// Marks the time when the driver started transmission for this slice to the device /// NOTE : This marks the time the driver started calling the transmit API's not when the data actually starts being transmitted /// UINT64 SendStopQpcTime; /// /// Marks the time when the send was reported as complete by the OS /// This is a optional time stamp that can be used if the driver uses asynchronous transmit API and uses a completion routine /// in the event the driver does not have a asynchronous completion routine should set this value to zero /// UINT64 SendCompleteQpcTime; IDDCX_FRAME_STATISTICS_FLAGS Flags; /// /// The total number of pixels processed in this frame /// UINT ProcessedPixelCount; /// /// Total size of the data send to device for this frame, this includes all the slices /// UINT FrameSizeInBytes; }; /// /// Either IDDCX_SWAPCHAIN is a handle so we know when it is invalid or we have a driver callback /// when the swapchain is destroyed so driver knows not to call this callback. /// Need this resolve for the other swapchain callbacks as well /// struct IDARG_IN_REPORTFRAMESTATISTICS { /// /// [in] Frame statics being reported /// IDDCX_FRAME_STATISTICS FrameStatistics; }; struct IDARG_IN_I2C_TRANSMIT { /// /// [in] The address of the I2C device from which data will be transmitted /// UINT SevenBitI2CAddress; /// /// [in] The size, in bytes, of the buffer pointed to by pData, this parameter must be between 1 and 64, inclusive /// UINT DataSizeInBytes; /// /// [in] A pointer to a buffer that holds the data to be transmitted /// _Field_size_full_(DataSizeInBytes) PVOID pData; }; struct IDARG_IN_SET_GAMMARAMP { /// /// [in] The type of gamma ramp being set /// IDDCX_GAMMARAMP_TYPE Type; /// /// [in] Size in bytes of the provided gamma ramp data. Set to zero for IDDCX_GAMMARAMP_TYPE_DEFAULT /// UINT GammaRampSizeInBytes; /// /// [in] Pointer to gamma ramp data to set. Set to NULL for IDDCX_GAMMARAMP_TYPE_DEFAULT /// _Field_size_bytes_opt_(GammaRampSizeInBytes) PVOID pGammaRampData; }; struct IDARG_IN_I2C_RECEIVE { /// /// [in] The address of the I2C device from which data will be received /// UINT SevenBitI2CAddress; /// /// [in] Flags for the receive operation /// UINT Flags; /// /// [in] The size, in bytes, of the buffer pointed to by pData /// UINT DataSizeInBytes; /// /// [out] A pointer to a buffer that receives the data. /// _Field_size_full_(DataSizeInBytes) PVOID pData; }; struct IDARG_IN_OPM_GET_CERTIFICATE_SIZE { /// /// [in] Type of certificate the size request is for /// OPM_VIDEO_OUTPUT_SEMANTICS CertificateType; }; struct IDARG_OUT_OPM_GET_CERTIFICATE_SIZE { /// /// [out] Size of certificate /// UINT CertificateSize; }; struct IDARG_IN_OPM_GET_CERTIFICATE { /// /// [in] Type of certificate the size request is for /// OPM_VIDEO_OUTPUT_SEMANTICS CertificateType; /// /// [in] Size of the buffer provided for the driver to copy the certificate to /// UINT CertificateBufferSizeInBytes; /// /// [out] A pointer to a buffer that the driver copies the certificate to. /// _Field_size_full_(CertificateBufferSizeInBytes) PVOID pCertificate; }; struct IDARG_IN_OPM_CREATE_PROTECTED_OUTPUT { /// /// [in] Type of semantics for this context /// OPM_VIDEO_OUTPUT_SEMANTICS VideoOutputSemantics; }; struct IDDCX_OPM_GET_RANDOM_NUMBER { /// /// Total size of the structure /// UINT Size; /// /// The random number the driver generated /// OPM_RANDOM_NUMBER RandomNumber; }; struct IDARG_OUT_OPM_GET_RANDOM_NUMBER { /// /// [out] The random number the driver generated /// IDDCX_OPM_GET_RANDOM_NUMBER RandomNumber; }; struct IDDCX_OPM_ENCRYPTED_INITIALIZATION_PARAMETERS { /// /// Total size of the structure /// UINT Size; /// /// Initialization parameters /// OPM_ENCRYPTED_INITIALIZATION_PARAMETERS EncryptedParameters; }; struct IDARG_IN_OPM_SET_SIGNING_KEY_AND_SEQUENCE_NUMBERS { /// /// [in] Initialization parameters /// IDDCX_OPM_ENCRYPTED_INITIALIZATION_PARAMETERS EncryptedParameters; }; struct IDDCX_OPM_GET_INFO_PARAMETERS { /// /// Total size of the structure /// UINT Size; /// /// Parameters for the get information request /// OPM_GET_INFO_PARAMETERS GetInfoParameters; }; struct IDARG_IN_OPM_GET_INFOMATION { /// /// [in] Parameters for the get information request /// IDDCX_OPM_GET_INFO_PARAMETERS GetInfoParameters; }; struct IDDCX_OPM_REQUESTED_INFORMATION { /// /// Total size of the structure /// UINT Size; /// /// The information that was requested /// OPM_REQUESTED_INFORMATION RequestedInformation; }; struct IDARG_OUT_OPM_GET_INFOMATION { /// /// [out] The information that was requested /// IDDCX_OPM_REQUESTED_INFORMATION RequestedInformation; }; struct IDDCX_OPM_CONFIGURE_PARAMETERS { /// /// Total size of the structure /// UINT Size; /// /// Configuration parameters /// OPM_CONFIGURE_PARAMETERS ConfigParameters; }; struct IDARG_IN_OPM_CONFIGURE_PROTECTED_OUTPUT { /// /// [in] Configuration parameters /// IDDCX_OPM_CONFIGURE_PARAMETERS ConfigParameters; /// /// [in] Size of additional parameter buffer /// UINT AdditionalParametersSizeInBytes; /// /// [in] A pointer to a buffer that the driver copies the certificate to. /// _Field_size_full_(AdditionalParametersSizeInBytes) PVOID pAdditionalParameters; }; struct IDARG_OUT_GETVERSION { /// /// [out] Configuration parameters /// ULONG IddCxVersion; }; struct IDARG_IN_REPORTCRITICALERROR { /// /// [In] The major error code for this critical error. Valid range 0-0xff inclusive. /// IddCx will add 0x100 to this value before passing to Windows Error Reporting when creating memory dump /// ULONG MajorErrorCode; /// /// [In] The minor error code for this critical error. Valid range 0-0xff inclusive /// ULONG MinorErrorCode; }; struct IDARG_IN_SETSRMLIST { /// /// [in] The size, in bytes, of the buffer pointed to by pSrmList /// UINT SrmListSizeInBytes; /// /// [in] A pointer to a buffer that holds the SRM list to pass to the appropriate /// Wddm driver. This buffer should contain the SRM in the format required by /// Digital Content Protection LLC for HDCP /// _Field_size_full_(SrmListSizeInBytes) PVOID pSrmList; }; struct IDARG_IN_GETSRMLISTVERSION { /// /// [in] The size in bytes of the pSrmListVerion being passed by driver to the OS /// A value of zero indicates that the driver is just querying the size of /// the SRM list version buffer that should be provided by the driver, in /// this case the OS will set buffer size in the output structure. /// Either SrmListVersionBufferInputCount needs to be zero and pSrmListVerion /// set to null or SrmListVersionBufferInputCount needs to be non-zero and /// pSrmListVerion needs to be non-null /// UINT SrmListVersionBufferInputCount; /// /// [out] Pointer to buffer that OS should copy the SRM list version to if /// the value is non-NULL. In this case the format of the version is defined by /// the PlayReady Porting Kit 4.0. /// If value is NULL then OS will not copy any data and OS will set the value /// IDARG_OUT_GETSRMLISTVERSION.SrmListVersionBufferOutputCount to indicate /// the size of buffer required to store the SRM list version /// _Field_size_opt_(SrmListVersionBufferInputCount) PVOID pSrmListVerion; }; struct IDARG_OUT_GETSRMLISTVERSION { /// /// [out] If IDARG_IN_GETSRMLISTVERSION.pSrmListVerion was NULL then OS will /// set this to the size of the buffer necessary to read the SRM list version /// description. /// If IDARG_IN_GETSRMLISTVERSION.pSrmListVerion was non-NULL then this /// is the number of bytes returned in /// IDARG_IN_GETSRMLISTVERSION.pSrmListVerion buffer /// If there was no SRM list set then SrmListVersionBufferOutputCount will be /// set to zero. /// UINT SrmListVersionBufferOutputCount; }; struct IDARG_IN_ADAPTERSETRENDERADAPTER { /// /// The LUID of the render adapter that the driver would like to be used /// to rendered the desktop image for the swapchains on this adapter. /// Setting a value of {0, 0} indicates that the driver has no preference for /// the render adapter used. /// This is a preference and the OS may decide to use a different render adapter /// for example if the specified adapter has been PnpStopped then the OS will /// pick an alternative /// LUID PreferredRenderAdapter; }; struct IDDCX_DISPLAYCONFIGPATH { /// /// Total size of the structure /// UINT Size; /// /// The handle the driver provides to identify the monitor this /// path is targeted at /// IDDCX_MONITOR MonitorObject; /// /// Requested desktop position for this path. /// POINT Position; /// /// Desktop resolution for this path. /// Must match a resolution supported by the driver /// DISPLAYCONFIG_2DREGION Resolution; /// /// Requested orientation for this path /// DISPLAYCONFIG_ROTATION Rotation; /// /// Requested refresh rate for this path /// Must match a refresh rate supported by the driver for this resolution /// NOTE: This refresh rate is defined as progressive as remote drivers can /// only support progressive target modes /// DISPLAYCONFIG_RATIONAL RefreshRate; /// /// The V Sync divider value for the specified RefreshRate /// UINT VSyncFreqDivider; /// /// Requested monitor DPI for this path, note this value is just a hint /// and OS may override the value to ensure the DPI configuration of /// the session is valid /// Valid values are 100 to 500 inclusive /// UINT MonitorScaleFactor; /// /// Physical width override for the specified monitor in millimeters, zero means no override /// UINT PhysicalWidthOverride; /// /// Physical height override for the specified monitor in millimeters, zero means no override /// UINT PhysicalHeightOverride; }; struct IDARG_IN_ADAPTERDISPLAYCONFIGUPDATE { /// /// [in] The number of paths in the pPaths array, this cannot be zero /// UINT PathCount; /// /// [in] Pointer to array of path display configuration /// _Field_size_(PathCount) IDDCX_DISPLAYCONFIGPATH* pPaths; }; struct IDARG_OUT_MONITORGETPHYSICALSIZE { /// /// Physical width of the specified monitor in millimeters, value cannot be zero /// UINT PhysicalWidth; /// /// Physical height of the specified monitor in millimeters, value cannot be zero /// UINT PhysicalHeight; }; struct IDDCX_SYSTEM_BUFFER_INFO { /// /// Total size of the structure in number of bytes /// UINT Size; /// /// Pitch/Stride of the surface in number of bytes /// UINT Pitch; /// /// Height of the surface in number of pixels /// UINT Height; /// /// Width of the surface in number of pixels /// UINT Width; /// /// Format of the surface pixel /// DXGI_FORMAT Format; /// /// A pointer (at-least 16 byte aligned) in system memory to the surface buffer /// VOID *pBuffer; }; struct IDARG_OUT_RELEASEANDACQUIRESYSTEMBUFFER { /// /// [out] Pointer to the struct containing per-frame metadata and frame information /// IDDCX_METADATA *pMetaData; /// /// [out] Pointer to the struct containing buffer's surface information /// IDDCX_SYSTEM_BUFFER_INFO *pBufferInfo; }; #pragma endregion #pragma region Structure Initialization VOID FORCEINLINE IDD_CX_CLIENT_CONFIG_INIT( _Out_ IDD_CX_CLIENT_CONFIG* Config ) { RtlZeroMemory(Config, sizeof(IDD_CX_CLIENT_CONFIG)); Config->Size = IDD_STRUCTURE_SIZE(IDD_CX_CLIENT_CONFIG); } #pragma endregion #pragma region Indirect Display APIs // // IDD Function: IddCxDeviceInitConfig // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXDEVICEINITCONFIG)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _Inout_ PWDFDEVICE_INIT DeviceInit, _In_ CONST IDD_CX_CLIENT_CONFIG* Config ); /// /// Inits a WDFDEVICE initialization structure to allow indirect displays to be used. /// _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxDeviceInitConfig( _Inout_ PWDFDEVICE_INIT DeviceInit, _In_ CONST IDD_CX_CLIENT_CONFIG* Config ) { return ((PFN_IDDCXDEVICEINITCONFIG) IddFunctions[IddCxDeviceInitConfigTableIndex])(IddDriverGlobals, DeviceInit, Config); } // // IDD Function: IddCxDeviceInitialize // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXDEVICEINITIALIZE)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ WDFDEVICE Device ); /// /// Initializes a WDF device /// _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxDeviceInitialize( _In_ WDFDEVICE Device ) { return ((PFN_IDDCXDEVICEINITIALIZE) IddFunctions[IddCxDeviceInitializeTableIndex])(IddDriverGlobals, Device); } // // IDD Function: IddCxAdapterInitAsync // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXADAPTERINITASYNC)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ CONST IDARG_IN_ADAPTER_INIT* pInArgs, _Out_ IDARG_OUT_ADAPTER_INIT* pOutArgs ); /// /// This will be called by driver to create a WDDM graphics adapter /// /// The handle the driver provides so the OS can reference this adapter when calling the driver /// Input arguments to the function /// Output arguments to the function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxAdapterInitAsync( _In_ CONST IDARG_IN_ADAPTER_INIT* pInArgs, _Out_ IDARG_OUT_ADAPTER_INIT* pOutArgs ) { return ((PFN_IDDCXADAPTERINITASYNC) IddFunctions[IddCxAdapterInitAsyncTableIndex])(IddDriverGlobals, pInArgs, pOutArgs); } // // IDD Function: IddCxMonitorCreate // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXMONITORCREATE)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_ADAPTER AdapterObject, _In_ CONST IDARG_IN_MONITORCREATE* pInArgs, _Out_ IDARG_OUT_MONITORCREATE* pOutArgs ); /// /// An OS callback function the driver calls to create a monitor object that can later be used for arrival. /// /// The adapter object that is hosting the newly arrived monitor /// Input arguments to the function /// Output arguments to the function /// /// If the routine succeeds it return STATUS_SUCCESS otherwise it returns one the follwing error codes: /// STATUS_MONITOR_NO_DESCRIPTOR - Only DisplayID is present, but no EDID /// STATUS_MONITOR_INVALID_DESCRIPTOR_CHECKSUM - DisplayID checksum is incorrect /// STATUS_NOT_SUPPORTED - Too many target modes /// _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxMonitorCreate( _In_ IDDCX_ADAPTER AdapterObject, _In_ CONST IDARG_IN_MONITORCREATE* pInArgs, _Out_ IDARG_OUT_MONITORCREATE* pOutArgs ) { return ((PFN_IDDCXMONITORCREATE) IddFunctions[IddCxMonitorCreateTableIndex])(IddDriverGlobals, AdapterObject, pInArgs, pOutArgs); } // // IDD Function: IddCxMonitorArrival // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXMONITORARRIVAL)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_MONITOR MonitorObject, _Out_ IDARG_OUT_MONITORARRIVAL* pOutArgs ); /// /// An OS callback function the driver calls report a monitor arrival on the WDDM graphics adapter /// /// The monitor object that is hosting the newly arrived monitor /// Output arguments to the function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxMonitorArrival( _In_ IDDCX_MONITOR MonitorObject, _Out_ IDARG_OUT_MONITORARRIVAL* pOutArgs ) { return ((PFN_IDDCXMONITORARRIVAL) IddFunctions[IddCxMonitorArrivalTableIndex])(IddDriverGlobals, MonitorObject, pOutArgs); } // // IDD Function: IddCxMonitorDeparture // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXMONITORDEPARTURE)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_MONITOR MonitorObject ); /// /// An OS callback function the driver calls report a monitor departure from the WDDM graphics adapter /// /// The monitor object that is departing /// Input arguments to the function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxMonitorDeparture( _In_ IDDCX_MONITOR MonitorObject ) { return ((PFN_IDDCXMONITORDEPARTURE) IddFunctions[IddCxMonitorDepartureTableIndex])(IddDriverGlobals, MonitorObject); } // // IDD Function: IddCxMonitorUpdateModes // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXMONITORUPDATEMODES)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_MONITOR MonitorObject, _In_ CONST IDARG_IN_UPDATEMODES* pInArgs ); /// /// An OS callback function the driver calls to update the mode list /// /// The monitor object being updated /// Input arguments of function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxMonitorUpdateModes( _In_ IDDCX_MONITOR MonitorObject, _In_ CONST IDARG_IN_UPDATEMODES* pInArgs ) { return ((PFN_IDDCXMONITORUPDATEMODES) IddFunctions[IddCxMonitorUpdateModesTableIndex])(IddDriverGlobals, MonitorObject, pInArgs); } // // IDD Function: IddCxAdapterUpdateMaxDisplayPipelineRate // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXADAPTERUPDATEMAXDISPLAYPIPELINERATE)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_ADAPTER hOsAdapterContext, _In_ CONST IDARG_IN_MAXDISPLAYPIPELINERATE* pInArgs ); /// /// An OS callback function the driver calls report that the max display pipeline rate has changed /// /// This is the OS context handle for this adapter returned by the IddCxSTart call /// Input arguments to the function /// Output arguments to the function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxAdapterUpdateMaxDisplayPipelineRate( _In_ IDDCX_ADAPTER hOsAdapterContext, _In_ CONST IDARG_IN_MAXDISPLAYPIPELINERATE* pInArgs ) { return ((PFN_IDDCXADAPTERUPDATEMAXDISPLAYPIPELINERATE) IddFunctions[IddCxAdapterUpdateMaxDisplayPipelineRateTableIndex])(IddDriverGlobals, hOsAdapterContext, pInArgs); } // // IDD Function: IddCxMonitorSetupHardwareCursor // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXMONITORSETUPHARDWARECURSOR)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_MONITOR MonitorObject, _In_ CONST IDARG_IN_SETUP_HWCURSOR* pInArgs ); /// /// An OS callback function the driver calls when it wants to setup hardware cursor support for the path. By default when a /// mode is committed on a path software cursor is enabled, if the driver want to accelerate the cursor on that path it uses /// this callback to enable hardware cursor support /// /// The handle the OS provided to identify the monitor /// Input arguments of function /// /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code. /// _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxMonitorSetupHardwareCursor( _In_ IDDCX_MONITOR MonitorObject, _In_ CONST IDARG_IN_SETUP_HWCURSOR* pInArgs ) { return ((PFN_IDDCXMONITORSETUPHARDWARECURSOR) IddFunctions[IddCxMonitorSetupHardwareCursorTableIndex])(IddDriverGlobals, MonitorObject, pInArgs); } // // IDD Function: IddCxMonitorQueryHardwareCursor // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXMONITORQUERYHARDWARECURSOR)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_MONITOR MonitorObject, _In_ CONST IDARG_IN_QUERY_HWCURSOR* pInArgs, _Out_ IDARG_OUT_QUERY_HWCURSOR* pOutArgs ); /// /// An OS callback function the driver calls when it wants obtain the updated cursor information, driver normally only calls /// this when the event that signals cursor update has triggered /// /// This is the OS context handle for this monitor returned by the IddCxMonitorArrival call /// Input arguments of function /// Output arguments of function /// /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code. /// _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxMonitorQueryHardwareCursor( _In_ IDDCX_MONITOR MonitorObject, _In_ CONST IDARG_IN_QUERY_HWCURSOR* pInArgs, _Out_ IDARG_OUT_QUERY_HWCURSOR* pOutArgs ) { return ((PFN_IDDCXMONITORQUERYHARDWARECURSOR) IddFunctions[IddCxMonitorQueryHardwareCursorTableIndex])(IddDriverGlobals, MonitorObject, pInArgs, pOutArgs); } // // IDD Function: IddCxSwapChainSetDevice // typedef _Must_inspect_result_ WDFAPI HRESULT (NTAPI *PFN_IDDCXSWAPCHAINSETDEVICE)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_SWAPCHAIN SwapChainObject, _In_ CONST IDARG_IN_SWAPCHAINSETDEVICE* pInArgs ); /// /// An OS callback function the driver calls within its SetSwapChain routine to setup the swap-chain with a particular DXGI device. /// _Must_inspect_result_ FORCEINLINE HRESULT IddCxSwapChainSetDevice( _In_ IDDCX_SWAPCHAIN SwapChainObject, _In_ CONST IDARG_IN_SWAPCHAINSETDEVICE* pInArgs ) { return ((PFN_IDDCXSWAPCHAINSETDEVICE) IddFunctions[IddCxSwapChainSetDeviceTableIndex])(IddDriverGlobals, SwapChainObject, pInArgs); } // // IDD Function: IddCxSwapChainReleaseAndAcquireBuffer // typedef _Must_inspect_result_ WDFAPI HRESULT (NTAPI *PFN_IDDCXSWAPCHAINRELEASEANDACQUIREBUFFER)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_SWAPCHAIN SwapChainObject, _Out_ IDARG_OUT_RELEASEANDACQUIREBUFFER* pOutArgs ); /// /// An OS callback function the driver calls when it wants to release the current buffer in the swapchain and acquire a new one /// The OS singles the IDARG_IN_SETSWAPCHAIN.hNextSurfaceAvailable event when the next buffer is ready to acquire. /// /// The swap-chain object passed to the EVT_IDD_CX_MONITOR_SET_SWAPCHAIN call. /// Output arguments of function /// /// If the routine succeeds it return S_OK otherwise an appropriate error code. /// E_PENDING indicates that there was not a new buffer to acquire, this should not occur if driver is only calling after the event is signaled /// _Must_inspect_result_ FORCEINLINE HRESULT IddCxSwapChainReleaseAndAcquireBuffer( _In_ IDDCX_SWAPCHAIN SwapChainObject, _Out_ IDARG_OUT_RELEASEANDACQUIREBUFFER* pOutArgs ) { return ((PFN_IDDCXSWAPCHAINRELEASEANDACQUIREBUFFER) IddFunctions[IddCxSwapChainReleaseAndAcquireBufferTableIndex])(IddDriverGlobals, SwapChainObject, pOutArgs); } // // IDD Function: IddCxSwapChainGetDirtyRects // typedef _Must_inspect_result_ WDFAPI HRESULT (NTAPI *PFN_IDDCXSWAPCHAINGETDIRTYRECTS)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_SWAPCHAIN SwapChainObject, _In_ CONST IDARG_IN_GETDIRTYRECTS* pInArgs, _Out_ IDARG_OUT_GETDIRTYRECTS* pOutArgs ); /// /// An OS callback function the driver calls when it wants retrieve the dirty rects for the current frame /// /// The swap-chain object whose current frame is being queried. /// Input arguments of function /// Output arguments of function /// /// If the routine succeeds it return S_OK otherwise an appropriate error code. /// _Must_inspect_result_ FORCEINLINE HRESULT IddCxSwapChainGetDirtyRects( _In_ IDDCX_SWAPCHAIN SwapChainObject, _In_ CONST IDARG_IN_GETDIRTYRECTS* pInArgs, _Out_ IDARG_OUT_GETDIRTYRECTS* pOutArgs ) { return ((PFN_IDDCXSWAPCHAINGETDIRTYRECTS) IddFunctions[IddCxSwapChainGetDirtyRectsTableIndex])(IddDriverGlobals, SwapChainObject, pInArgs, pOutArgs); } // // IDD Function: IddCxSwapChainGetMoveRegions // typedef _Must_inspect_result_ WDFAPI HRESULT (NTAPI *PFN_IDDCXSWAPCHAINGETMOVEREGIONS)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_SWAPCHAIN SwapChainObject, _In_ CONST IDARG_IN_GETMOVEREGIONS* pInArgs, _Out_ IDARG_OUT_GETMOVEREGIONS* pOutArgs ); /// /// An OS callback function the driver calls when it wants retrieve the move regions for the current frame /// /// The swap-chain object whose current frame is being queried. /// Input arguments of function /// Output arguments of function /// /// If the routine succeeds it return S_OK otherwise an appropriate error code. /// _Must_inspect_result_ FORCEINLINE HRESULT IddCxSwapChainGetMoveRegions( _In_ IDDCX_SWAPCHAIN SwapChainObject, _In_ CONST IDARG_IN_GETMOVEREGIONS* pInArgs, _Out_ IDARG_OUT_GETMOVEREGIONS* pOutArgs ) { return ((PFN_IDDCXSWAPCHAINGETMOVEREGIONS) IddFunctions[IddCxSwapChainGetMoveRegionsTableIndex])(IddDriverGlobals, SwapChainObject, pInArgs, pOutArgs); } // // IDD Function: IddCxSwapChainFinishedProcessingFrame // typedef _Must_inspect_result_ WDFAPI HRESULT (NTAPI *PFN_IDDCXSWAPCHAINFINISHEDPROCESSINGFRAME)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_SWAPCHAIN SwapChainObject ); /// /// An OS callback function the driver calls report all GPU command for processing this frame have been queue /// For example if the driver copies the buffer to a staging surface so it can lock and copy the /// pixel data to the CPU then the driver should call this callback once the copy from surface to staging surface /// has been submitted (eg Dxgi CopyResource API called) /// If the driver does not call this callback the desktop will not update, it is invalid to call ReleaseAndAcquireBuffer() /// before calling FinishedProcessingFrame /// /// The swap-chain object whose current frame is being queried. /// If the routine succeeds it return S_OK otherwise an appropriate error code. _Must_inspect_result_ FORCEINLINE HRESULT IddCxSwapChainFinishedProcessingFrame( _In_ IDDCX_SWAPCHAIN SwapChainObject ) { return ((PFN_IDDCXSWAPCHAINFINISHEDPROCESSINGFRAME) IddFunctions[IddCxSwapChainFinishedProcessingFrameTableIndex])(IddDriverGlobals, SwapChainObject); } // // IDD Function: IddCxSwapChainReportFrameStatistics // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXSWAPCHAINREPORTFRAMESTATISTICS)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_SWAPCHAIN SwapChainObject, _In_ CONST IDARG_IN_REPORTFRAMESTATISTICS* pInArgs ); /// /// An OS callback function the driver calls report the frame statics after it has processed a frame completely /// /// The swap-chain object whose current frame is being queried. /// Input arguments to the function /// Output arguments to the function /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxSwapChainReportFrameStatistics( _In_ IDDCX_SWAPCHAIN SwapChainObject, _In_ CONST IDARG_IN_REPORTFRAMESTATISTICS* pInArgs ) { return ((PFN_IDDCXSWAPCHAINREPORTFRAMESTATISTICS) IddFunctions[IddCxSwapChainReportFrameStatisticsTableIndex])(IddDriverGlobals, SwapChainObject, pInArgs); } // // IDD Function: IddCxGetVersion // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXGETVERSION)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _Out_ IDARG_OUT_GETVERSION* pOutArgs ); /// /// An OS callback function the driver calls to find the IddCx version /// /// Output arguments of function /// /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code. /// _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxGetVersion( _Out_ IDARG_OUT_GETVERSION* pOutArgs ) { return ((PFN_IDDCXGETVERSION) IddFunctions[IddCxGetVersionTableIndex])(IddDriverGlobals, pOutArgs); } // // IDD Function: IddCxReportCriticalError // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXREPORTCRITICALERROR)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_opt_ IDDCX_ADAPTER AdapterObject, _In_ CONST IDARG_IN_REPORTCRITICALERROR* pInArgs ); /// /// An OS callback function the driver calls to report a critical error. /// The OS will bugcheck the driver will the following bugcheck code : /// (pInArgs->MajorErrorCode+0x100 << 8) + pInArgs->MinorErrorCode /// Wastson dump will be generated and driver process will terminate and restart /// according the UMDF driver restart policy. /// As a user mode memory dump is generated the driver should place any useful /// debug info on the stack of the function that calls this callback /// /// /// The adapter object that is the critical error occurred on /// If the error occurred before a IddCxAdapter was created pass in nullptr /// Input arguments to the function /// /// If the routine succeeds it never returns to the driver as the driver process will be /// terminated /// _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxReportCriticalError( _In_opt_ IDDCX_ADAPTER AdapterObject, _In_ CONST IDARG_IN_REPORTCRITICALERROR* pInArgs ) { return ((PFN_IDDCXREPORTCRITICALERROR) IddFunctions[IddCxReportCriticalErrorTableIndex])(IddDriverGlobals, AdapterObject, pInArgs); } // // IDD Function: IddCxMonitorSetSrmList // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXMONITORSETSRMLIST)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_MONITOR MonitorObject, _In_ CONST IDARG_IN_SETSRMLIST* pInArgs ); /// /// An OS callback function the driver calls when it wants pass a HDCP SRM list to /// the GPU driver associated with the rendering of the specified monitor /// /// The monitor object that the SRM list is associated with /// Input arguments of function /// /// If the routine succeeds it returns STATUS_SUCCESS otherwise an appropriate error /// code. /// STATUS_GRAPHICS_OPM_NOT_SUPPORTED will be returned if the GPU driver does not /// support this new functionality. /// STATUS_GRAPHICS_OPM_INVALID_SRM will be returned if the GPU driver does /// recognize the format of the SRM list, this include if the driver detected /// the list had been tampered with /// _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxMonitorSetSrmList( _In_ IDDCX_MONITOR MonitorObject, _In_ CONST IDARG_IN_SETSRMLIST* pInArgs ) { return ((PFN_IDDCXMONITORSETSRMLIST) IddFunctions[IddCxMonitorSetSrmListTableIndex])(IddDriverGlobals, MonitorObject, pInArgs); } // // IDD Function: IddCxMonitorGetSrmListVersion // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXMONITORGETSRMLISTVERSION)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_MONITOR MonitorObject, _In_ CONST IDARG_IN_GETSRMLISTVERSION* pInArgs, _Out_ IDARG_OUT_GETSRMLISTVERSION* pOutArgs ); /// /// An OS callback function the driver calls when it wants to retrieve the latest SRM /// list version stored by the GPU /// /// The monitor object that the SRM list is associated with /// Input arguments of function /// Output arguments of function /// /// If the routine succeeds it returns STATUS_SUCCESS otherwise an appropriate error /// code. /// STATUS_GRAPHICS_OPM_NOT_SUPPORTED will be returned if the GPU driver does not /// support this new functionality. /// STATUS_NO_DATA_DETECTED will be returned if the GPU does not have a current SRM /// list /// STATUS_BUFFER_TOO_SMALL will be return if the passed in buffer is too small /// _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxMonitorGetSrmListVersion( _In_ IDDCX_MONITOR MonitorObject, _In_ CONST IDARG_IN_GETSRMLISTVERSION* pInArgs, _Out_ IDARG_OUT_GETSRMLISTVERSION* pOutArgs ) { return ((PFN_IDDCXMONITORGETSRMLISTVERSION) IddFunctions[IddCxMonitorGetSrmListVersionTableIndex])(IddDriverGlobals, MonitorObject, pInArgs, pOutArgs); } // // IDD Function: IddCxAdapterSetRenderAdapter // typedef WDFAPI VOID (NTAPI *PFN_IDDCXADAPTERSETRENDERADAPTER)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_ADAPTER AdapterObject, _In_ CONST IDARG_IN_ADAPTERSETRENDERADAPTER* pInArgs ); /// /// An OS callback function the driver can call to set the preferred render adapter /// used to render the swapchains for the specified adapter /// /// The adapter object of the adapter the rendering adapter preference is being set for /// Input arguments of function /// None /// /// The driver can call this at anytime to change the preferred render adapter, the driver can use /// Dxgi enumeration to find the required render adapter LUID. When this is called /// the OS will attempt to re-create any existing swapchains onto the specified render adapter and /// hence the user may see some visual glitches/artifacts. /// It is recommended that if possible for the driver to make this call before adding any monitors. /// FORCEINLINE VOID IddCxAdapterSetRenderAdapter( _In_ IDDCX_ADAPTER AdapterObject, _In_ CONST IDARG_IN_ADAPTERSETRENDERADAPTER* pInArgs ) { #if defined(IDD_EVERYTHING_ALWAYS_AVAILABLE) ((PFN_IDDCXADAPTERSETRENDERADAPTER) IddFunctions[IddCxAdapterSetRenderAdapterTableIndex])(IddDriverGlobals, AdapterObject, pInArgs); #else if (IDD_IS_FUNCTION_AVAILABLE(IddCxAdapterSetRenderAdapter)) { ((PFN_IDDCXADAPTERSETRENDERADAPTER) IddFunctions[IddCxAdapterSetRenderAdapterTableIndex])(IddDriverGlobals, AdapterObject, pInArgs); } else { ((PFN_WDFDRIVERERRORREPORTAPIMISSING) WdfFunctions[WdfDriverErrorReportApiMissingTableIndex])(WdfDriverGlobals, WdfGetDriver(), IddFrameworkExtensionName, IddCxAdapterSetRenderAdapterTableIndex, FALSE); } #endif } // // IDD Function: IddCxAdapterDisplayConfigUpdate // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXADAPTERDISPLAYCONFIGUPDATE)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_ADAPTER AdapterObject, _In_ CONST IDARG_IN_ADAPTERDISPLAYCONFIGUPDATE* pInArgs ); /// /// An OS callback function the driver can call to set the preferred render adapter used to /// render the swapchains for the specified adapter /// /// The adapter object of the remote adapter that the display configuration is specified for /// Input arguments of function /// /// On success STATUS_SUCCESS is returned otherwise an appropriate error code. /// /// /// If STATUS_SUCCESS is returned then the OS has stored the new display configuration specified and /// asynchronously the changes will reconfigure the swapchains for the monitors as requested. /// This call will first flush any pending monitor arrivals or departures will be process to ensure /// list of monitor is current. /// If the call determines the supplied display configuration is not currently supported by the driver /// it will return STATUS_INVALID_PARAMETER and the reason will be logged using WPP for debugging /// purposes, for example is a given resolution/refresh rate are not supported or if an invalid /// monitor is specified. /// _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxAdapterDisplayConfigUpdate( _In_ IDDCX_ADAPTER AdapterObject, _In_ CONST IDARG_IN_ADAPTERDISPLAYCONFIGUPDATE* pInArgs ) { #if defined(IDD_EVERYTHING_ALWAYS_AVAILABLE) return ((PFN_IDDCXADAPTERDISPLAYCONFIGUPDATE) IddFunctions[IddCxAdapterDisplayConfigUpdateTableIndex])(IddDriverGlobals, AdapterObject, pInArgs); #else if (IDD_IS_FUNCTION_AVAILABLE(IddCxAdapterDisplayConfigUpdate)) { return ((PFN_IDDCXADAPTERDISPLAYCONFIGUPDATE) IddFunctions[IddCxAdapterDisplayConfigUpdateTableIndex])(IddDriverGlobals, AdapterObject, pInArgs); } else { return ((PFN_WDFDRIVERERRORREPORTAPIMISSING) WdfFunctions[WdfDriverErrorReportApiMissingTableIndex])(WdfDriverGlobals, WdfGetDriver(), IddFrameworkExtensionName, IddCxAdapterDisplayConfigUpdateTableIndex, TRUE); } #endif } // // IDD Function: IddCxSwapChainInSystemMemory // typedef _Must_inspect_result_ WDFAPI HRESULT (NTAPI *PFN_IDDCXSWAPCHAININSYSTEMMEMORY)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_SWAPCHAIN SwapChainObject, _Out_ BOOL* pInSystemMemory ); /// /// Fills in a boolean value, TRUE when the swapchain buffers are allocated in system memory and false otherwise /// /// The swap-chain object passed to the EVT_IDD_CX_MONITOR_SET_SWAPCHAIN call. /// Output arguments of function /// /// If the routine succeeds it return S_OK otherwise an appropriate error code. /// _Must_inspect_result_ FORCEINLINE HRESULT IddCxSwapChainInSystemMemory( _In_ IDDCX_SWAPCHAIN SwapChainObject, _Out_ BOOL* pInSystemMemory ) { #if defined(IDD_EVERYTHING_ALWAYS_AVAILABLE) return ((PFN_IDDCXSWAPCHAININSYSTEMMEMORY) IddFunctions[IddCxSwapChainInSystemMemoryTableIndex])(IddDriverGlobals, SwapChainObject, pInSystemMemory); #else if (IDD_IS_FUNCTION_AVAILABLE(IddCxSwapChainInSystemMemory)) { return ((PFN_IDDCXSWAPCHAININSYSTEMMEMORY) IddFunctions[IddCxSwapChainInSystemMemoryTableIndex])(IddDriverGlobals, SwapChainObject, pInSystemMemory); } else { ((PFN_WDFDRIVERERRORREPORTAPIMISSING) WdfFunctions[WdfDriverErrorReportApiMissingTableIndex])(WdfDriverGlobals, WdfGetDriver(), IddFrameworkExtensionName, IddCxSwapChainInSystemMemoryTableIndex, FALSE); return (HRESULT)0; } #endif } // // IDD Function: IddCxSwapChainReleaseAndAcquireSystemBuffer // typedef _Must_inspect_result_ WDFAPI HRESULT (NTAPI *PFN_IDDCXSWAPCHAINRELEASEANDACQUIRESYSTEMBUFFER)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_SWAPCHAIN SwapChainObject, _Out_ IDARG_OUT_RELEASEANDACQUIRESYSTEMBUFFER* pOutArgs ); /// /// Performs a release and acquire on the swapchain, but also maps the buffers for cpu access. Information required /// to access the buffers is filled into the IDDCX_SYSTEM_BUFFER_INFO struct pointer inside IDARG_OUT_RELEASEANDACQUIRESYSTEMBUFFER /// /// The swap-chain object passed to the EVT_IDD_CX_MONITOR_SET_SWAPCHAIN call. /// Output arguments of function /// /// If the routine succeeds it return S_OK otherwise an appropriate error code. /// E_PENDING indicates that there was not a new buffer to acquire, this should not occur if driver is only calling after the event is signaled /// _Must_inspect_result_ FORCEINLINE HRESULT IddCxSwapChainReleaseAndAcquireSystemBuffer( _In_ IDDCX_SWAPCHAIN SwapChainObject, _Out_ IDARG_OUT_RELEASEANDACQUIRESYSTEMBUFFER* pOutArgs ) { #if defined(IDD_EVERYTHING_ALWAYS_AVAILABLE) return ((PFN_IDDCXSWAPCHAINRELEASEANDACQUIRESYSTEMBUFFER) IddFunctions[IddCxSwapChainReleaseAndAcquireSystemBufferTableIndex])(IddDriverGlobals, SwapChainObject, pOutArgs); #else if (IDD_IS_FUNCTION_AVAILABLE(IddCxSwapChainReleaseAndAcquireSystemBuffer)) { return ((PFN_IDDCXSWAPCHAINRELEASEANDACQUIRESYSTEMBUFFER) IddFunctions[IddCxSwapChainReleaseAndAcquireSystemBufferTableIndex])(IddDriverGlobals, SwapChainObject, pOutArgs); } else { ((PFN_WDFDRIVERERRORREPORTAPIMISSING) WdfFunctions[WdfDriverErrorReportApiMissingTableIndex])(WdfDriverGlobals, WdfGetDriver(), IddFrameworkExtensionName, IddCxSwapChainReleaseAndAcquireSystemBufferTableIndex, FALSE); return (HRESULT)0; } #endif } // // IDD Function: IddCxSwapChainGetPhysicallyContiguousAddress // typedef _Must_inspect_result_ WDFAPI HRESULT (NTAPI *PFN_IDDCXSWAPCHAINGETPHYSICALLYCONTIGUOUSADDRESS)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_SWAPCHAIN SwapChainObject, _Out_ PHYSICAL_ADDRESS* pSurfaceAddresss ); /// /// Fills in a PHYSICAL_ADDRESS value of the currently acquired surface if allocated in physically contiguous memory /// /// The swap-chain object passed to the EVT_IDD_CX_MONITOR_SET_SWAPCHAIN call. /// Output arguments of function /// /// If the routine succeeds it return S_OK, if the surface was not allocated in physically contiguous memory it will return E_NOINTERFACE /// On success, pSurfaceAddress is filled with the physical address of the surface /// _Must_inspect_result_ FORCEINLINE HRESULT IddCxSwapChainGetPhysicallyContiguousAddress( _In_ IDDCX_SWAPCHAIN SwapChainObject, _Out_ PHYSICAL_ADDRESS* pSurfaceAddresss ) { #if defined(IDD_EVERYTHING_ALWAYS_AVAILABLE) return ((PFN_IDDCXSWAPCHAINGETPHYSICALLYCONTIGUOUSADDRESS) IddFunctions[IddCxSwapChainGetPhysicallyContiguousAddressTableIndex])(IddDriverGlobals, SwapChainObject, pSurfaceAddresss); #else if (IDD_IS_FUNCTION_AVAILABLE(IddCxSwapChainGetPhysicallyContiguousAddress)) { return ((PFN_IDDCXSWAPCHAINGETPHYSICALLYCONTIGUOUSADDRESS) IddFunctions[IddCxSwapChainGetPhysicallyContiguousAddressTableIndex])(IddDriverGlobals, SwapChainObject, pSurfaceAddresss); } else { ((PFN_WDFDRIVERERRORREPORTAPIMISSING) WdfFunctions[WdfDriverErrorReportApiMissingTableIndex])(WdfDriverGlobals, WdfGetDriver(), IddFrameworkExtensionName, IddCxSwapChainGetPhysicallyContiguousAddressTableIndex, FALSE); return (HRESULT)0; } #endif } // // IDD Function: IddCxMonitorQueryHardwareCursor2 // typedef _Must_inspect_result_ WDFAPI NTSTATUS (NTAPI *PFN_IDDCXMONITORQUERYHARDWARECURSOR2)( _In_ PIDD_DRIVER_GLOBALS DriverGlobals, _In_ IDDCX_MONITOR MonitorObject, _In_ CONST IDARG_IN_QUERY_HWCURSOR* pInArgs, _Out_ IDARG_OUT_QUERY_HWCURSOR2* pOutArgs ); /// /// An OS callback function the driver calls when it wants obtain the updated cursor information, driver normally only calls /// this when the event that signals cursor update has triggered. /// This function is a replacement for IddCxMonitorQueryHardwareCursor() providing more information. /// /// This is the OS context handle for this monitor returned by the IddCxMonitorArrival call /// Input arguments of function /// Output arguments of function /// /// If the routine succeeds it return STATUS_SUCCESS otherwise an appropriate error code. /// _Must_inspect_result_ FORCEINLINE NTSTATUS IddCxMonitorQueryHardwareCursor2( _In_ IDDCX_MONITOR MonitorObject, _In_ CONST IDARG_IN_QUERY_HWCURSOR* pInArgs, _Out_ IDARG_OUT_QUERY_HWCURSOR2* pOutArgs ) { #if defined(IDD_EVERYTHING_ALWAYS_AVAILABLE) return ((PFN_IDDCXMONITORQUERYHARDWARECURSOR2) IddFunctions[IddCxMonitorQueryHardwareCursor2TableIndex])(IddDriverGlobals, MonitorObject, pInArgs, pOutArgs); #else if (IDD_IS_FUNCTION_AVAILABLE(IddCxMonitorQueryHardwareCursor2)) { return ((PFN_IDDCXMONITORQUERYHARDWARECURSOR2) IddFunctions[IddCxMonitorQueryHardwareCursor2TableIndex])(IddDriverGlobals, MonitorObject, pInArgs, pOutArgs); } else { return ((PFN_WDFDRIVERERRORREPORTAPIMISSING) WdfFunctions[WdfDriverErrorReportApiMissingTableIndex])(WdfDriverGlobals, WdfGetDriver(), IddFrameworkExtensionName, IddCxMonitorQueryHardwareCursor2TableIndex, TRUE); } #endif } #pragma endregion WDF_EXTERN_C_END #endif // _IDDCX_H_