前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Intel IGCL规格指南和示例代码

Intel IGCL规格指南和示例代码

作者头像
ccf19881030
发布2024-01-06 10:38:45
2270
发布2024-01-06 10:38:45
举报
文章被收录于专栏:ccf19881030的博客ccf19881030的博客

Intel IGCL规格指南和示例代码

IGCL 旨在成为用于硬件(主要是图形)所有控制方面的高级 API 的集合。它取代了传统的英特尔 CUISDK,后者过去仅发布给 OEM 和选定的客户。 IGCL 允许对显示、媒体和 3D 功能进行全局控制和调整。 相关官网地址为: IGCL Specification1.1-Introduction

Intel IGCL Introduction
Intel IGCL Introduction
IGCL指南
IGCL指南

相关控制API在线文档地址为:Control API Specification - Version 1

Control API Specification - Version 1
Control API Specification - Version 1

源代码示例地址Intel官方已经托管到了Github仓库上, 具体地址为:https://github.com/intel/drivers.gpu.control-library

drivers.gpu.control-library
drivers.gpu.control-library

代码下载之后的目录结构如下图所示:

drivers.gpu.control-library
drivers.gpu.control-library

1.0版本的代码地址为:https://github.com/intel/drivers.gpu.control-library/releases/tag/Code_Ver1.0

1.0版本代码地址
1.0版本代码地址

示例源代码运行方式

由于drivers.gpu.control-library示例是基于CMake组织的,里面的Samples目录有很多示例程序,如下图所示:

Samples示例代码目录结构
Samples示例代码目录结构

参考drivers.gpu.control-library中的说明,以Power_Feature_Samples示例程序为例,我们可以执行cmake.exe -B <output_folder> -S <cmake_source_folder> -G "Visual Studio 17 2022" -A x64这种命令去生成对应的VS2022的.sln工程文件,然后运行即可。 首先在E:\SoftDevelop\Github_Projects\drivers.gpu.control-library\Samples\Power_Feature_Samples目录下创建一个build目录,然后运行cmake.exe -B build -S . -G "Visual Studio 17 2022" -A x64,当然前提是你自己安装了Visual Studio 2022CMake等工具

在这里插入图片描述
在这里插入图片描述

接着使用VS2022打开E:\SoftDevelop\Github_Projects\drivers.gpu.control-library\Samples\Power_Feature_Samples\build目录下的Power_Feature_Samples.sln文件,如下图所示:

Power_Feature_Samples.sln工程文件
Power_Feature_Samples.sln工程文件
VS2022项目
VS2022项目

运行ALL_BUILD,在drivers.gpu.control-library\Samples\Power_Feature_Samples\build\Debug目录会生成一个Power_Feature_Samples.exePower_Feature_Samples.lib文件,但是运行时会报错,如下图所示:

运行报错
运行报错

调试跟踪示例程序,发现是ctlInit接口调用失败,加载ControlLib.dll动态库失败了,暂时在英特尔提供的官方文档没有找到对应的ControlLib.dll动态库。 关于错误码0x40000026可以在drivers.gpu.control-library\includes中的igcl_api.h头文件找到具体定义:

代码语言:javascript
复制
 CTL_RESULT_ERROR_LOAD = 0x40000026,             ///< Library load failure
代码语言:javascript
复制
///
/// @brief Defines Return/Error codes.
///        All generic error (bit30) codes are between 0x40000000-0x4000FFFF.
///        All 3D (bit 29) specific error codes are between 0x60000000-0x6000FFFF.
///        All media (bit 28) specific error codes are between 0x50000000-0x5000FFFF.
///        All display (bit 27) specific error codes are between 0x48000000-0x4800FFFF
///        All core (bit 26) specific error codes are between 0x44000000-0x4400FFFF
///        Success result code with additional info are between 0x00000001-0x0000FFFF.
typedef enum _ctl_result_t
{
   CTL_RESULT_SUCCESS = 0x00000000,                ///< success
   CTL_RESULT_SUCCESS_STILL_OPEN_BY_ANOTHER_CALLER = 0x00000001,   ///< success but still open by another caller
   CTL_RESULT_ERROR_SUCCESS_END = 0x0000FFFF,      ///< "Success group error code end value, not to be used
                                                   ///< "
   CTL_RESULT_ERROR_GENERIC_START = 0x40000000,    ///< Generic error code starting value, not to be used
   CTL_RESULT_ERROR_NOT_INITIALIZED = 0x40000001,  ///< Result not initialized
   CTL_RESULT_ERROR_ALREADY_INITIALIZED = 0x40000002,  ///< Already initialized
   CTL_RESULT_ERROR_DEVICE_LOST = 0x40000003,      ///< Device hung, reset, was removed, or driver update occurred
   CTL_RESULT_ERROR_OUT_OF_HOST_MEMORY = 0x40000004,   ///< Insufficient host memory to satisfy call
   CTL_RESULT_ERROR_OUT_OF_DEVICE_MEMORY = 0x40000005, ///< Insufficient device memory to satisfy call
   CTL_RESULT_ERROR_INSUFFICIENT_PERMISSIONS = 0x40000006, ///< Access denied due to permission level
   CTL_RESULT_ERROR_NOT_AVAILABLE = 0x40000007,    ///< Resource was removed
   CTL_RESULT_ERROR_UNINITIALIZED = 0x40000008,    ///< Library not initialized
   CTL_RESULT_ERROR_UNSUPPORTED_VERSION = 0x40000009,  ///< Generic error code for unsupported versions
   CTL_RESULT_ERROR_UNSUPPORTED_FEATURE = 0x4000000a,  ///< Generic error code for unsupported features
   CTL_RESULT_ERROR_INVALID_ARGUMENT = 0x4000000b, ///< Generic error code for invalid arguments
   CTL_RESULT_ERROR_INVALID_API_HANDLE = 0x4000000c,   ///< API handle in invalid
   CTL_RESULT_ERROR_INVALID_NULL_HANDLE = 0x4000000d,  ///< Handle argument is not valid
   CTL_RESULT_ERROR_INVALID_NULL_POINTER = 0x4000000e, ///< Pointer argument may not be nullptr
   CTL_RESULT_ERROR_INVALID_SIZE = 0x4000000f,     ///< Size argument is invalid (e.g., must not be zero)
   CTL_RESULT_ERROR_UNSUPPORTED_SIZE = 0x40000010, ///< Size argument is not supported by the device (e.g., too large)
   CTL_RESULT_ERROR_UNSUPPORTED_IMAGE_FORMAT = 0x40000011, ///< Image format is not supported by the device
   CTL_RESULT_ERROR_DATA_READ = 0x40000012,        ///< Data read error
   CTL_RESULT_ERROR_DATA_WRITE = 0x40000013,       ///< Data write error
   CTL_RESULT_ERROR_DATA_NOT_FOUND = 0x40000014,   ///< Data not found error
   CTL_RESULT_ERROR_NOT_IMPLEMENTED = 0x40000015,  ///< Function not implemented
   CTL_RESULT_ERROR_OS_CALL = 0x40000016,          ///< Operating system call failure
   CTL_RESULT_ERROR_KMD_CALL = 0x40000017,         ///< Kernel mode driver call failure
   CTL_RESULT_ERROR_UNLOAD = 0x40000018,           ///< Library unload failure
   CTL_RESULT_ERROR_ZE_LOADER = 0x40000019,        ///< Level0 loader not found
   CTL_RESULT_ERROR_INVALID_OPERATION_TYPE = 0x4000001a,   ///< Invalid operation type
   CTL_RESULT_ERROR_NULL_OS_INTERFACE = 0x4000001b,///< Null OS interface
   CTL_RESULT_ERROR_NULL_OS_ADAPATER_HANDLE = 0x4000001c,  ///< Null OS adapter handle
   CTL_RESULT_ERROR_NULL_OS_DISPLAY_OUTPUT_HANDLE = 0x4000001d,///< Null display output handle
   CTL_RESULT_ERROR_WAIT_TIMEOUT = 0x4000001e,     ///< Timeout in Wait function
   CTL_RESULT_ERROR_PERSISTANCE_NOT_SUPPORTED = 0x4000001f,///< Persistance not supported
   CTL_RESULT_ERROR_PLATFORM_NOT_SUPPORTED = 0x40000020,   ///< Platform not supported
   CTL_RESULT_ERROR_UNKNOWN_APPLICATION_UID = 0x40000021,  ///< Unknown Appplicaion UID in Initialization call 
   CTL_RESULT_ERROR_INVALID_ENUMERATION = 0x40000022,  ///< The enum is not valid
   CTL_RESULT_ERROR_FILE_DELETE = 0x40000023,      ///< Error in file delete operation
   CTL_RESULT_ERROR_RESET_DEVICE_REQUIRED = 0x40000024,///< The device requires a reset.
   CTL_RESULT_ERROR_FULL_REBOOT_REQUIRED = 0x40000025, ///< The device requires a full reboot.
   CTL_RESULT_ERROR_LOAD = 0x40000026,             ///< Library load failure
   CTL_RESULT_ERROR_UNKNOWN = 0x4000FFFF,          ///< Unknown or internal error
   CTL_RESULT_ERROR_RETRY_OPERATION = 0x40010000,  ///< Operation failed, retry previous operation again
   CTL_RESULT_ERROR_GENERIC_END = 0x4000FFFF,      ///< "Generic error code end value, not to be used
                                                   ///< "
   CTL_RESULT_ERROR_CORE_START = 0x44000000,       ///< Core error code starting value, not to be used
   CTL_RESULT_ERROR_CORE_OVERCLOCK_NOT_SUPPORTED = 0x44000001, ///< The Overclock is not supported.
   CTL_RESULT_ERROR_CORE_OVERCLOCK_VOLTAGE_OUTSIDE_RANGE = 0x44000002, ///< The Voltage exceeds the acceptable min/max.
   CTL_RESULT_ERROR_CORE_OVERCLOCK_FREQUENCY_OUTSIDE_RANGE = 0x44000003,   ///< The Frequency exceeds the acceptable min/max.
   CTL_RESULT_ERROR_CORE_OVERCLOCK_POWER_OUTSIDE_RANGE = 0x44000004,   ///< The Power exceeds the acceptable min/max.
   CTL_RESULT_ERROR_CORE_OVERCLOCK_TEMPERATURE_OUTSIDE_RANGE = 0x44000005, ///< The Power exceeds the acceptable min/max.
   CTL_RESULT_ERROR_CORE_OVERCLOCK_IN_VOLTAGE_LOCKED_MODE = 0x44000006,///< The Overclock is in voltage locked mode.
   CTL_RESULT_ERROR_CORE_OVERCLOCK_RESET_REQUIRED = 0x44000007,///< It indicates that the requested change will not be applied until the
                                                   ///< device is reset.
   CTL_RESULT_ERROR_CORE_OVERCLOCK_WAIVER_NOT_SET = 0x44000008,///< The $OverclockWaiverSet function has not been called.
   CTL_RESULT_ERROR_CORE_END = 0x0440FFFF,         ///< "Core error code end value, not to be used
                                                   ///< "
   CTL_RESULT_ERROR_3D_START = 0x60000000,         ///< 3D error code starting value, not to be used
   CTL_RESULT_ERROR_3D_END = 0x6000FFFF,           ///< "3D error code end value, not to be used
                                                   ///< "
   CTL_RESULT_ERROR_MEDIA_START = 0x50000000,      ///< Media error code starting value, not to be used
   CTL_RESULT_ERROR_MEDIA_END = 0x5000FFFF,        ///< "Media error code end value, not to be used
                                                   ///< "
   CTL_RESULT_ERROR_DISPLAY_START = 0x48000000,    ///< Display error code starting value, not to be used
   CTL_RESULT_ERROR_INVALID_AUX_ACCESS_FLAG = 0x48000001,  ///< Invalid flag for Aux access
   CTL_RESULT_ERROR_INVALID_SHARPNESS_FILTER_FLAG = 0x48000002,///< Invalid flag for Sharpness
   CTL_RESULT_ERROR_DISPLAY_NOT_ATTACHED = 0x48000003, ///< Error for Display not attached
   CTL_RESULT_ERROR_DISPLAY_NOT_ACTIVE = 0x48000004,   ///< Error for display attached but not active
   CTL_RESULT_ERROR_INVALID_POWERFEATURE_OPTIMIZATION_FLAG = 0x48000005,   ///< Error for invalid power optimization flag
   CTL_RESULT_ERROR_INVALID_POWERSOURCE_TYPE_FOR_DPST = 0x48000006,///< DPST is supported only in DC Mode
   CTL_RESULT_ERROR_INVALID_PIXTX_GET_CONFIG_QUERY_TYPE = 0x48000007,  ///< Invalid query type for pixel transformation get configuration
   CTL_RESULT_ERROR_INVALID_PIXTX_SET_CONFIG_OPERATION_TYPE = 0x48000008,  ///< Invalid operation type for pixel transformation set configuration
   CTL_RESULT_ERROR_INVALID_SET_CONFIG_NUMBER_OF_SAMPLES = 0x48000009, ///< Invalid number of samples for pixel transformation set configuration
   CTL_RESULT_ERROR_INVALID_PIXTX_BLOCK_ID = 0x4800000a,   ///< Invalid block id for pixel transformation
   CTL_RESULT_ERROR_INVALID_PIXTX_BLOCK_TYPE = 0x4800000b, ///< Invalid block type for pixel transformation
   CTL_RESULT_ERROR_INVALID_PIXTX_BLOCK_NUMBER = 0x4800000c,   ///< Invalid block number for pixel transformation
   CTL_RESULT_ERROR_INSUFFICIENT_PIXTX_BLOCK_CONFIG_MEMORY = 0x4800000d,   ///< Insufficient memery allocated for BlockConfigs
   CTL_RESULT_ERROR_3DLUT_INVALID_PIPE = 0x4800000e,   ///< Invalid pipe for 3dlut
   CTL_RESULT_ERROR_3DLUT_INVALID_DATA = 0x4800000f,   ///< Invalid 3dlut data
   CTL_RESULT_ERROR_3DLUT_NOT_SUPPORTED_IN_HDR = 0x48000010,   ///< 3dlut not supported in HDR
   CTL_RESULT_ERROR_3DLUT_INVALID_OPERATION = 0x48000011,  ///< Invalid 3dlut operation
   CTL_RESULT_ERROR_3DLUT_UNSUCCESSFUL = 0x48000012,   ///< 3dlut call unsuccessful
   CTL_RESULT_ERROR_AUX_DEFER = 0x48000013,        ///< AUX defer failure
   CTL_RESULT_ERROR_AUX_TIMEOUT = 0x48000014,      ///< AUX timeout failure
   CTL_RESULT_ERROR_AUX_INCOMPLETE_WRITE = 0x48000015, ///< AUX incomplete write failure
   CTL_RESULT_ERROR_I2C_AUX_STATUS_UNKNOWN = 0x48000016,   ///< I2C/AUX unkonown failure
   CTL_RESULT_ERROR_I2C_AUX_UNSUCCESSFUL = 0x48000017, ///< I2C/AUX unsuccessful
   CTL_RESULT_ERROR_LACE_INVALID_DATA_ARGUMENT_PASSED = 0x48000018,///< Lace Incorrrect AggressivePercent data or LuxVsAggressive Map data
                                                   ///< passed by user
   CTL_RESULT_ERROR_EXTERNAL_DISPLAY_ATTACHED = 0x48000019,///< External Display is Attached hence fail the Display Switch
   CTL_RESULT_ERROR_CUSTOM_MODE_STANDARD_CUSTOM_MODE_EXISTS = 0x4800001a,  ///< Standard custom mode exists
   CTL_RESULT_ERROR_CUSTOM_MODE_NON_CUSTOM_MATCHING_MODE_EXISTS = 0x4800001b,  ///< Non custom matching mode exists
   CTL_RESULT_ERROR_CUSTOM_MODE_INSUFFICIENT_MEMORY = 0x4800001c,  ///< Custom mode insufficent memory
   CTL_RESULT_ERROR_ADAPTER_ALREADY_LINKED = 0x4800001d,   ///< Adapter is already linked
   CTL_RESULT_ERROR_ADAPTER_NOT_IDENTICAL = 0x4800001e,///< Adapter is not identical for linking
   CTL_RESULT_ERROR_ADAPTER_NOT_SUPPORTED_ON_LDA_SECONDARY = 0x4800001f,   ///< Adapter is LDA Secondary, so not supporting requested operation
   CTL_RESULT_ERROR_SET_FBC_FEATURE_NOT_SUPPORTED = 0x48000020,///< Set FBC Feature not supported
   CTL_RESULT_ERROR_DISPLAY_END = 0x4800FFFF,      ///< "Display error code end value, not to be used
                                                   ///< "
   CTL_RESULT_MAX

} ctl_result_t;
本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2024-01-05,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Intel IGCL规格指南和示例代码
    • 示例源代码运行方式
    领券
    问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档