ADL (AMD Display Library) Public APIs
Version 17.1
|
#include "adl_sdk.h"
#include "amd_only/amd_structures.h"
#include "adapter.h"
#include "display.h"
#include "workstation.h"
#include "displaysmanager.h"
Go to the source code of this file.
Functions | |
int | ADL2_Main_Control_Create (ADL_MAIN_MALLOC_CALLBACK callback, int iEnumConnectedAdapters, ADL_CONTEXT_HANDLE *context) |
Function to initialize the ADL2 interface and to obtain client's context handle. More... | |
int | ADL2_Main_Control_Destroy (ADL_CONTEXT_HANDLE context) |
Destroy client's ADL context. More... | |
void * | ADL2_Main_Control_GetProcAddress (ADL_CONTEXT_HANDLE context, void *lpModule, char *lpProcName) |
ADL local interface. Function to determine the validity of and retrieve the function pointer (similar to the GetProcAdress API) for a specified function. More... | |
int | ADL2_Main_Control_Refresh (ADL_CONTEXT_HANDLE context) |
Function to refresh adapter information. This function generates an adapter index value for all logical adapters that have ever been present in the system. More... | |
int | ADL2_Main_ControlX2_Create (ADL_MAIN_MALLOC_CALLBACK callback, int iEnumConnectedAdapters, ADL_CONTEXT_HANDLE *context, ADLThreadingModel threadingModel) |
Function to initialize the ADL2 interface and issue client's context handle. More... | |
int | ADL2_Main_ControlX3_Create (ADL_MAIN_MALLOC_CALLBACK callback, int iEnumConnectedAdapters, ADL_CONTEXT_HANDLE *context, ADLThreadingModel threadingModel, int adlCreateOptions) |
Function to initialize the ADL2 interface and issue client's context handle. More... | |
int | ADL2_PerGPU_GDEvent_Register (ADL_CONTEXT_HANDLE context, int iAdapterIndex, int clientID, int eventID, void *evntHandle) |
int | ADL2_PerGPU_GDEvent_UnRegister (ADL_CONTEXT_HANDLE context, int iAdapterIndex, int clientID, int eventID, void *evntHandle) |
int | ADL2_RegisterEvent (ADL_CONTEXT_HANDLE context, int eventID, void *evntHandle) |
int | ADL2_RegisterEventX2 (ADL_CONTEXT_HANDLE context, int iAdapterIndex, int clientID, int eventID, void *evntHandle) |
int | ADL2_UnRegisterEvent (ADL_CONTEXT_HANDLE context, int eventID, void *evntHandle) |
int | ADL2_UnRegisterEventX2 (ADL_CONTEXT_HANDLE context, int iAdapterIndex, int clientID, int eventID, void *evntHandle) |
int | ADL_Main_Control_Create (ADL_MAIN_MALLOC_CALLBACK callback, int iEnumConnectedAdapters) |
Function to initialize the ADL interface. This function should be called first. More... | |
int | ADL_Main_Control_Destroy () |
Function to destroy ADL global pointers. This function should be called last. More... | |
void * | ADL_Main_Control_GetProcAddress (void *lpModule, char *lpProcName) |
ADL local interface. Function to determine the validity of and retrieve the function pointer (similar to the GetProcAdress API) for a specified function. More... | |
int | ADL_Main_Control_Refresh () |
Function to refresh adapter information. This function generates an adapter index value for all logical adapters that have ever been present in the system. More... | |
int | ADL_Main_ControlX2_Create (ADL_MAIN_MALLOC_CALLBACK callback, int iEnumConnectedAdapters, ADLThreadingModel threadingModel) |
Function to initialize the ADL interface. This function should be called first. More... | |
int ADL2_Main_Control_Create | ( | ADL_MAIN_MALLOC_CALLBACK | callback, |
int | iEnumConnectedAdapters, | ||
ADL_CONTEXT_HANDLE * | context | ||
) |
Function to initialize the ADL2 interface and to obtain client's context handle.
Clients can use ADL2 versions of ADL APIs to assure that there is no interference with other ADL clients that are running in the same process. Such clients have to call ADL2_Main_Control_Create first to obtain ADL_CONTEXT_HANDLE instance that has to be passed to each subsequent ADL2 call and finally destroyed using ADL2_Main_Control_Destroy. ADL initialized using ADL2_Main_Control_Create will not enforce serialization of ADL API executions by multiple threads. Multiple threads will be allowed to enter to ADL at the same time. Note that ADL library is not guaranteed to be thread-safe. Client that calls ADL2_Main_Control_Create have to provide its own mechanism for ADL calls serialization.
[in] | callback | The memory allocation function for memory buffer allocation. This must be provided by the user. ADL internally uses this callback to allocate memory for the output parameters returned to the user and user is responsible to free the memory once used for these parameters. ADL internal takes care of allocating and de allocating the memory for its local variables. |
[in] | iEnumConnectedAdapters | Specify a value of 0 to retrieve adapter information for all adapters that have ever been present in the system. Specify a value of 1 to retrieve adapter information only for adapters that are physically present and enabled in the system. |
[out] | context | ADL_CONTEXT_HANDLE instance that has to be passed to each subsequent ADL2 call and finally destroyed using ADL2_Main_Control_Destroy. |
int ADL2_Main_Control_Destroy | ( | ADL_CONTEXT_HANDLE | context | ) |
Destroy client's ADL context.
Clients can use ADL2 versions of ADL APIs to assure that there is no interference with other ADL clients that are running in the same process and to assure that ADL APIs are thread-safe. Such clients have to call ADL2_Main_Control_Create first to obtain ADL_CONTEXT_HANDLE instance that has to be passed to each subsequent ADL2 call and finally destroyed using ADL2_Main_Control_Destroy.
[in] | context | ADL_CONTEXT_HANDLE instance to destroy. |
void* ADL2_Main_Control_GetProcAddress | ( | ADL_CONTEXT_HANDLE | context, |
void * | lpModule, | ||
char * | lpProcName | ||
) |
ADL local interface. Function to determine the validity of and retrieve the function pointer (similar to the GetProcAdress API) for a specified function.
This function returns the function pointer of a specified function if it is valid (defined and exposed in a DLL module). Call this function to ensure that a function is valid before calling it.
[in] | context | Client's ADL context handle ADL_CONTEXT_HANDLE obtained from ADL2_Main_Control_Create. |
[in] | lpModule | The pointer to the desired handle of the DLL. |
[in] | lpProcName | The pointer to the desired function name. |
int ADL2_Main_Control_Refresh | ( | ADL_CONTEXT_HANDLE | context | ) |
Function to refresh adapter information. This function generates an adapter index value for all logical adapters that have ever been present in the system.
This function updates the adapter information based on the logical adapters currently in the system. The adapter index and UDID mappings remain unchanged for each refresh call.
[in] | context | Client's ADL context handle ADL_CONTEXT_HANDLE obtained from ADL2_Main_Control_Create. |
int ADL2_Main_ControlX2_Create | ( | ADL_MAIN_MALLOC_CALLBACK | callback, |
int | iEnumConnectedAdapters, | ||
ADL_CONTEXT_HANDLE * | context, | ||
ADLThreadingModel | threadingModel | ||
) |
Function to initialize the ADL2 interface and issue client's context handle.
Clients can use ADL2 versions of ADL APIs to assure that there is no interference with other ADL clients that are running in the same process. Such clients have to call ADL2_Main_Control_Create first to obtain ADL_CONTEXT_HANDLE instance that has to be passed to each subsequent ADL2 call and finally destroyed using ADL2_Main_Control_Destroy. ADL2_Main_ControlX2_Create allows the client to specify desired threading behavior of ADL APIs.
[in] | callback | The memory allocation function for memory buffer allocation. This must be provided by the user. This must be provided by the user. ADL internally uses this callback to allocate memory for the output parameters returned to the user and user is responsible to free the memory once used for these parameters. ADL internal takes care of allocating and de allocating the memory for its local variables. |
[in] | iEnumConnectedAdapters | Specify a value of 0 to retrieve adapter information for all adapters that have ever been present in the system. Specify a value of 1 to retrieve adapter information only for adapters that are physically present and enabled in the system. |
[out] | context | ADL_CONTEXT_HANDLE instance that has to be passed to each subsequent ADL2 call and finally destroyed using ADL2_Main_Control_Destroy. |
[in] | threadingModel | Specify ADL threading behavior. |
int ADL2_Main_ControlX3_Create | ( | ADL_MAIN_MALLOC_CALLBACK | callback, |
int | iEnumConnectedAdapters, | ||
ADL_CONTEXT_HANDLE * | context, | ||
ADLThreadingModel | threadingModel, | ||
int | adlCreateOptions | ||
) |
Function to initialize the ADL2 interface and issue client's context handle.
Clients can use ADL2 versions of ADL APIs to assure that there is no interference with other ADL clients that are running in the same process. Such clients have to call ADL2_Main_Control_Create first to obtain ADL_CONTEXT_HANDLE instance that has to be passed to each subsequent ADL2 call and finally destroyed using ADL2_Main_Control_Destroy. ADL2_Main_ControlX3_Create allows customizing ADL GPU behavior by allowing to caller to pass a set of 32 bits integer
[in] | callback | The memory allocation function for memory buffer allocation. This must be provided by the user. This must be provided by the user. ADL internally uses this callback to allocate memory for the output parameters returned to the user and user is responsible to free the memory once used for these parameters. ADL internal takes care of allocating and de allocating the memory for its local variables. |
[in] | iEnumConnectedAdapters | Specify a value of 0 to retrieve adapter information for all adapters that have ever been present in the system. Specify a value of 1 to retrieve adapter information only for adapters that are physically present and enabled in the system. |
[out] | context | ADL_CONTEXT_HANDLE instance that has to be passed to each subsequent ADL2 call and finally destroyed using ADL2_Main_Control_Destroy. |
[in] | threadingModel | Specify ADL threading behavior. |
[in] | adlCreateOptions | it will allow customizing ADL GPU behavior by allowing to caller to pass a set of 32 bits. Each bit customizes particular behavior. First usage of the flags is to customize how ADL will report adapters that are AMD but have incompatible driver installed. Setting 0 to first bit will force ADL to report such adapters as none-AMD (vendor -1002) , setting 1 to first bit will force AMD to report such adapters vendor as AMD (1002) |
int ADL2_PerGPU_GDEvent_Register | ( | ADL_CONTEXT_HANDLE | context, |
int | iAdapterIndex, | ||
int | clientID, | ||
int | eventID, | ||
void * | evntHandle | ||
) |
Client calls the function passing id of the event it listens to and handle of the event object. The graphics driver sets the event object when corresponding event occurs in the system. If the event is registered for a given GPU, unregister also needs for a given GPU. If the event is registered for each GPU, unregister is also for each GPU.
[in] | context | Client's ADL context handle ADL_CONTEXT_HANDLE obtained from ADL2_Main_Control_Create. |
[in] | adapterIndex | an integer indicates a GPU. If is -1, then the API will register the event to each GPU |
[in] | eventId | Numeric value that represents the event ID the client listens to. |
[in] | clientID | An integer indicate who register the event. It is optional , for third part it is 0 |
[in] | evntHandle | Reference to the event object that will be set by the driver when corresponding event occurs in the system. Client obtains the handle using Win32 Create event API. |
int ADL2_PerGPU_GDEvent_UnRegister | ( | ADL_CONTEXT_HANDLE | context, |
int | iAdapterIndex, | ||
int | clientID, | ||
int | eventID, | ||
void * | evntHandle | ||
) |
Client calls the function passing id of the event and un-register event. If the event is registered for a given GPU, unregister also needs for a given GPU. If the event is registered for each GPU, unregister is also for each GPU.
[in] | context | Client's ADL context handle ADL_CONTEXT_HANDLE obtained from ADL2_Main_Control_Create. |
[in] | adapterIndex | an integer indicate a GPU. If is -1, then need to unregister to each GPU. |
[in] | eventId | Numeric value that represents the event ID the client listens to. |
[in] | clientID | An integer indicate who register the event. It is optional , for third part it is 0 |
[in] | evntHandle | Reference to the event object that will be set by the driver when corresponding event occurs in the system. Client obtains the handle using Win32 Create Event API. |
int ADL2_RegisterEvent | ( | ADL_CONTEXT_HANDLE | context, |
int | eventID, | ||
void * | evntHandle | ||
) |
Client calls the function passing id of the event it listens to and handle of the event object. The graphics driver sets the event object when corresponding event occurs in the system.
[in] | context | Client's ADL context handle ADL_CONTEXT_HANDLE obtained from ADL2_Main_Control_Create. |
[in] | eventId | Numeric value that represents the event ID the client listens to. |
[in] | evntHandle | Reference to the event object that will be set by the driver when corresponding event occurs in the system. Client obtains the handle using Win32 CreateEvent API. |
int ADL2_RegisterEventX2 | ( | ADL_CONTEXT_HANDLE | context, |
int | iAdapterIndex, | ||
int | clientID, | ||
int | eventID, | ||
void * | evntHandle | ||
) |
Client calls the function passing id of the event it listens to and handle of the event object. The graphics driver sets the event object when corresponding event occurs in the system.
[in] | context | Client's ADL context handle ADL_CONTEXT_HANDLE obtained from ADL2_Main_Control_Create. |
[in] | eventId | Numeric value that represents the event ID the client listens to. |
[in] | evntHandle | Reference to the event object that will be set by the driver when corresponding event occurs in the system. Client obtains the handle using Win32 CreateEvent API. |
int ADL2_UnRegisterEvent | ( | ADL_CONTEXT_HANDLE | context, |
int | eventID, | ||
void * | evntHandle | ||
) |
Client calls the function passing id of the event it listens to and handle of the event object. The graphics driver will stop seting the event object when corresponding event occurs in the system.
[in] | context | Client's ADL context handle ADL_CONTEXT_HANDLE obtained from ADL2_Main_Control_Create. |
[in] | eventId | Numeric value that represents the event ID the client listens to. |
[in] | evntHandle | Reference to the event object that will need to be unregistered. Client obtains the handle using Win32 CreateEvent API. Client has to call CloseHandle Win32 API after it unregisters the handle. |
int ADL2_UnRegisterEventX2 | ( | ADL_CONTEXT_HANDLE | context, |
int | iAdapterIndex, | ||
int | clientID, | ||
int | eventID, | ||
void * | evntHandle | ||
) |
Client calls the function passing id of the event it listens to and handle of the event object. The graphics driver will stop seting the event object when corresponding event occurs in the system.
[in] | context | Client's ADL context handle ADL_CONTEXT_HANDLE obtained from ADL2_Main_Control_Create. |
[in] | eventId | Numeric value that represents the event ID the client listens to. |
[in] | evntHandle | Reference to the event object that will need to be unregistered. Client obtains the handle using Win32 CreateEvent API. Client has to call CloseHandle Win32 API after it unregisters the handle. |
int ADL_Main_Control_Create | ( | ADL_MAIN_MALLOC_CALLBACK | callback, |
int | iEnumConnectedAdapters | ||
) |
Function to initialize the ADL interface. This function should be called first.
This function initializes the ADL library. ADL initialized using ADL_Main_Control_Create will not enforce serialization of ADL API executions by multiple threads. Multiple threads will be allowed to enter to ADL at the same time. Note that ADL library is not guaranteed to be thread-safe. Client that calls ADL_Main_Control_Create have to provide its own mechanism for ADL calls serialization. It also initializes global pointers and, at the same time, calls the ADL_Main_Control_Refresh function.
[in] | callback | The memory allocation function for memory buffer allocation. This must be provided by the user. ADL internally uses this callback to allocate memory for the output parameters returned to the user and user is responsible to free the memory once used for these parameters. ADL internal takes care of allocating and de allocating the memory for its local variables. |
[in] | iEnumConnectedAdapters | Specify a value of 0 to retrieve adapter information for all adapters that have ever been present in the system. Specify a value of 1 to retrieve adapter information only for adapters that are physically present and enabled in the system. |
int ADL_Main_Control_Destroy | ( | ) |
Function to destroy ADL global pointers. This function should be called last.
All ADL global buffers and resources are released after this function is called.
void* ADL_Main_Control_GetProcAddress | ( | void * | lpModule, |
char * | lpProcName | ||
) |
ADL local interface. Function to determine the validity of and retrieve the function pointer (similar to the GetProcAdress API) for a specified function.
This function returns the function pointer of a specified function if it is valid (defined and exposed in a DLL module). Call this function to ensure that a function is valid before calling it.
[in] | lpModule | The pointer to the desired handle of the DLL. |
[in] | lpProcName | The pointer to the desired function name. |
int ADL_Main_Control_Refresh | ( | ) |
Function to refresh adapter information. This function generates an adapter index value for all logical adapters that have ever been present in the system.
This function updates the adapter information based on the logical adapters currently in the system. The adapter index and UDID mappings remain unchanged for each refresh call.
int ADL_Main_ControlX2_Create | ( | ADL_MAIN_MALLOC_CALLBACK | callback, |
int | iEnumConnectedAdapters, | ||
ADLThreadingModel | threadingModel | ||
) |
Function to initialize the ADL interface. This function should be called first.
This function initializes the ADL library. Allows the client to specify desired threading behavior of ADL APIs. It also initializes global pointers and, at the same time, calls the ADL_Main_Control_Refresh function.
[in] | callback | The memory allocation function for memory buffer allocation. This must be provided by the user. This must be provided by the user. ADL internally uses this callback to allocate memory for the output parameters returned to the user and user is responsible to free the memory once used for these parameters. ADL internal takes care of allocating and de allocating the memory for its local variables. |
[in] | iEnumConnectedAdapters | Specify a value of 0 to retrieve adapter information for all adapters that have ever been present in the system. Specify a value of 1 to retrieve adapter information only for adapters that are physically present and enabled in the system. |
[in] | threadingModel | Specify ADL threading behavior. |