From a06dbe17e6cfa7dba4a92996e81de1d104fc8769 Mon Sep 17 00:00:00 2001 From: GfxDisplayBot Date: Wed, 24 Dec 2025 02:19:22 -0800 Subject: [PATCH] Updated version to v262 --- .../DisplaySettings_Sample_App.cpp | 98 +++++++- Samples/Generic_Sample/Sample_ControlAPP.cpp | 11 +- .../I2C_AUX_Samples/I2C_AUX_Sample_App.cpp | 221 ++++++++++++++++++ .../Sample_OverclockAPP.cpp | 2 +- Samples/inc/GenericIGCLApp.h | 59 +++++ Source/cApiWrapper.cpp | 3 +- include/igcl_api.h | 7 +- 7 files changed, 390 insertions(+), 11 deletions(-) diff --git a/Samples/DisplaySettings/DisplaySettings_Sample_App.cpp b/Samples/DisplaySettings/DisplaySettings_Sample_App.cpp index 1fa23b3..f2f10c3 100644 --- a/Samples/DisplaySettings/DisplaySettings_Sample_App.cpp +++ b/Samples/DisplaySettings/DisplaySettings_Sample_App.cpp @@ -325,6 +325,79 @@ ctl_result_t TestToGetSetSourceTonemapping(ctl_display_output_handle_t hDisplayO return Result; } +/*************************************************************** + * @brief + * Sample test for HDR10+ + * @param hDisplayOutput + * @return ctl_result_t + ***************************************************************/ +ctl_result_t TestHDR10Plus(ctl_display_output_handle_t hDisplayOutput) +{ + ctl_result_t Result = CTL_RESULT_SUCCESS; + ctl_display_settings_t AppliedDisplaySettings = { 0 }; + ctl_display_settings_t NewDisplaySettings = { 0 }; + bool IsControllable, IsSupported = FALSE; + + // GET CALL + AppliedDisplaySettings.Version = API_VERSION; + AppliedDisplaySettings.Size = sizeof(ctl_display_settings_t); + AppliedDisplaySettings.Set = FALSE; + AppliedDisplaySettings.ValidFlags = CTL_DISPLAY_SETTING_FLAG_LOW_LATENCY | CTL_DISPLAY_SETTING_FLAG_SOURCE_TM; + + Result = ctlGetSetDisplaySettings(hDisplayOutput, &AppliedDisplaySettings); + LOG_AND_EXIT_ON_ERROR(Result, "ctlGetSetDisplaySettings (LowLatency GET CALL)"); + + // LowLatency + IsControllable = (CTL_DISPLAY_SETTING_FLAG_LOW_LATENCY & AppliedDisplaySettings.ControllableFlags) ? TRUE : FALSE; + IsSupported = (CTL_DISPLAY_SETTING_FLAG_LOW_LATENCY & AppliedDisplaySettings.SupportedFlags) ? TRUE : FALSE; + + if ((FALSE == IsControllable) || (FALSE == IsSupported)) + { + APP_LOG_WARN("Get/Set LowLatency is not supported/controllable = %d/%d", IsSupported, IsControllable); + Result = CTL_RESULT_ERROR_UNSUPPORTED_FEATURE; + goto Exit; + } + APP_LOG_INFO(" Current Applied LowLatency is %d ", AppliedDisplaySettings.LowLatency); + + // SourceTM + IsControllable = (CTL_DISPLAY_SETTING_FLAG_SOURCE_TM & AppliedDisplaySettings.ControllableFlags) ? TRUE : FALSE; + IsSupported = (CTL_DISPLAY_SETTING_FLAG_SOURCE_TM & AppliedDisplaySettings.SupportedFlags) ? TRUE : FALSE; + + if ((FALSE == IsControllable) || (FALSE == IsSupported)) + { + APP_LOG_WARN("Get/Set SourceTM is not supported/controllable = %d/%d. Ensure HDR mode is enabled in OS settings.", IsSupported, IsControllable); + Result = CTL_RESULT_ERROR_UNSUPPORTED_FEATURE; + goto Exit; + } + APP_LOG_INFO(" Current Applied SourceTM is %d ", AppliedDisplaySettings.SourceTM); + + // CALL TO ENABLE HDR10+ LOW_LATENCY + NewDisplaySettings.Version = API_VERSION; + NewDisplaySettings.Size = sizeof(ctl_display_settings_t); + NewDisplaySettings.Set = TRUE; + NewDisplaySettings.ValidFlags = CTL_DISPLAY_SETTING_FLAG_LOW_LATENCY | CTL_DISPLAY_SETTING_FLAG_SOURCE_TM; + NewDisplaySettings.LowLatency = CTL_DISPLAY_SETTING_LOW_LATENCY_ENABLED; + NewDisplaySettings.SourceTM = CTL_DISPLAY_SETTING_SOURCETM_ENABLED; + + Result = ctlGetSetDisplaySettings(hDisplayOutput, &NewDisplaySettings); + LOG_AND_EXIT_ON_ERROR(Result, "ctlGetSetDisplaySettings (LowLatency_SourceTM SET CALL)"); + + // GET CALL + AppliedDisplaySettings = { 0 }; + AppliedDisplaySettings.Version = API_VERSION; + AppliedDisplaySettings.Size = sizeof(ctl_display_settings_t); + AppliedDisplaySettings.Set = FALSE; + AppliedDisplaySettings.ValidFlags = CTL_DISPLAY_SETTING_FLAG_LOW_LATENCY | CTL_DISPLAY_SETTING_FLAG_SOURCE_TM; + + Result = ctlGetSetDisplaySettings(hDisplayOutput, &AppliedDisplaySettings); + LOG_AND_EXIT_ON_ERROR(Result, "ctlGetSetDisplaySettings (LowLatency_SourceTM GET CALL)"); + APP_LOG_INFO(" Current LowLatency is %d ", AppliedDisplaySettings.LowLatency); + APP_LOG_INFO(" Current SourceTM is %d ", AppliedDisplaySettings.SourceTM); + +Exit: + return Result; +} + /*************************************************************** * @brief * Sample test for Get/Set Audio settings @@ -465,13 +538,26 @@ ctl_result_t EnumerateDisplayHandles(ctl_display_output_handle_t *hDisplayOutput Result = TestToGetSetContentType(hDisplayOutput[DisplayIndex]); STORE_AND_RESET_ERROR(Result); - // Get/Set HDR10+ Low Latency Flag - Result = TestToGetSetLowLatency(hDisplayOutput[DisplayIndex]); - STORE_AND_RESET_ERROR(Result); + if (DisplayProperties.FeatureSupportedFlags & CTL_STD_DISPLAY_FEATURE_FLAG_HDR10_PLUS_CERTIFIED) + { + APP_LOG_INFO("HDR10+ Certified Display is detected"); - // Get/Set HDR10+ Source Tonemapping Flag - Result = TestToGetSetSourceTonemapping(hDisplayOutput[DisplayIndex]); - STORE_AND_RESET_ERROR(Result); + // Get/Set HDR10+ Low Latency & SourceTM Flag + Result = TestHDR10Plus(hDisplayOutput[DisplayIndex]); + STORE_AND_RESET_ERROR(Result); + } + else + { + APP_LOG_INFO("HDR10+ Certified Display not detected"); + + // Get/Set HDR10+ Low Latency Flag + Result = TestToGetSetLowLatency(hDisplayOutput[DisplayIndex]); + STORE_AND_RESET_ERROR(Result); + + // Get/Set HDR10+ Source Tonemapping Flag + Result = TestToGetSetSourceTonemapping(hDisplayOutput[DisplayIndex]); + STORE_AND_RESET_ERROR(Result); + } // Get/Set Audio Endpoint Result = TestToGetSetAudioEndpoint(hDisplayOutput[DisplayIndex]); diff --git a/Samples/Generic_Sample/Sample_ControlAPP.cpp b/Samples/Generic_Sample/Sample_ControlAPP.cpp index c532929..b4ac3fd 100644 --- a/Samples/Generic_Sample/Sample_ControlAPP.cpp +++ b/Samples/Generic_Sample/Sample_ControlAPP.cpp @@ -423,6 +423,13 @@ ctl_result_t CtlGetDisplayPropertiesTest(ctl_device_adapter_handle_t hAdapter, c std::cout << "DisplayConfigFlags is " << pStdisplayproperties->DisplayConfigFlags << "\n"; std::cout << "Is Display Active : " << Isdisplay_active << "\n"; std::cout << "Is Display Attached : " << Isdisplay_attached << "\n"; + + std::cout << "Supported features\n"; + PrintStdDisplayFeatureFlags(pStdisplayproperties->FeatureSupportedFlags); + PrintIntelDisplayFeatureFlags(pStdisplayproperties->AdvancedFeatureSupportedFlags); + std::cout << "Enabled features\n "; + PrintStdDisplayFeatureFlags(pStdisplayproperties->FeatureEnabledFlags); + PrintIntelDisplayFeatureFlags(pStdisplayproperties->AdvancedFeatureEnabledFlags); } pStdisplayproperties->DisplayConfigFlags = 0; pStdisplayproperties->Os_display_encoder_handle.WindowsDisplayEncoderID = 0; @@ -926,8 +933,8 @@ ctl_result_t CtlAdapterTesting(ctl_device_adapter_handle_t *hDevices, uint32_t A if (StDeviceAdapterProperties.pDeviceID != nullptr) { - free(StDeviceAdapterProperties.pDeviceID); - StDeviceAdapterProperties.pDeviceID = nullptr; + free(StDeviceAdapterProperties.pDeviceID); + StDeviceAdapterProperties.pDeviceID = nullptr; } return Result; diff --git a/Samples/I2C_AUX_Samples/I2C_AUX_Sample_App.cpp b/Samples/I2C_AUX_Samples/I2C_AUX_Sample_App.cpp index 4dd9d5c..5a382c4 100644 --- a/Samples/I2C_AUX_Samples/I2C_AUX_Sample_App.cpp +++ b/Samples/I2C_AUX_Samples/I2C_AUX_Sample_App.cpp @@ -138,6 +138,211 @@ ctl_result_t TestI2CAUXAccess(ctl_display_output_handle_t hDisplayOutput) return Result; } +/*************************************************************** + * @brief TestI2CAccessWithDriverOverrideFlagsForMultipleReadTransactions + * Reference code to show how to use the I2C driver flags for multiple read transactions for HDMI displays + * @param hDisplayOutput + * @return ctl_result_t + ***************************************************************/ +ctl_result_t TestI2CAccessWithDriverOverrideFlagsForMultipleReadTransactions(ctl_display_output_handle_t hDisplayOutput) +{ +#define READ_DATA_SIZE 11 // the total read data size to +#define READ_SIZE_LIMIT 2 // the read data size limit for each I2C read transaction + + ctl_result_t Result = CTL_RESULT_SUCCESS; + ctl_i2c_access_args_t I2CArgs = { 0 }; // I2C Access + uint32_t ReadDataLeft = 0; + uint32_t ReadDataSent = 0; + uint32_t ReadDataSizeLimit = 0; + bool IsFirstReadTransaction = TRUE; + + // I2C WRITE : 82 01 10 AC at address 6E and subaddress 51 + // If we write these BYTEs ( 82 01 10 AC) to address 6E and + // subaddress 51, it should update the current brightness to the 10th + // byte at address 6E and subaddress 51. One can verify by changing + // panel brightness from panel buttons, writing to address 6E + // and subaddress 51 ( 82 01 10 AC), and then reading 10th byte at + // address 6E and subaddress 51. Here is an example of an 11 byte output: + // 6E 88 02 00 10 00 00 64 00 19 D9. The 10th byte value is the current brightness value of the + // panel. To confirm whether this value is correct or not, convert the Hex + // value to Decimal. In this example, the 10th byte is 0x19, which represents 25% panel brightness. + I2CArgs.Size = sizeof(ctl_i2c_access_args_t); + I2CArgs.OpType = CTL_OPERATION_TYPE_WRITE; + I2CArgs.Address = 0x6E; // Address used for demonstration purpose + I2CArgs.Offset = 0x51; // Offset used for demonstration purpose + I2CArgs.DataSize = 4; + I2CArgs.Data[0] = 0x82; + I2CArgs.Data[1] = 0x01; + I2CArgs.Data[2] = 0x10; + I2CArgs.Data[3] = 0xAC; + + EXIT_ON_MEM_ALLOC_FAILURE(hDisplayOutput, "hDisplayOutput"); + + APP_LOG_INFO("I2C Write Test using I2C driver override flags for multiple read transactions"); + + Result = ctlI2CAccess(hDisplayOutput, &I2CArgs); + + if (CTL_RESULT_SUCCESS != Result) + { + APP_LOG_ERROR("ctlI2CAccess for I2C write returned failure code: 0x%X", Result); + STORE_AND_RESET_ERROR(Result); + } + + // I2C READ : 82 01 10 AC at address 6E and subaddress 51 + APP_LOG_INFO("I2C Read Transaction Test using I2C driver override flags for multiple read transactions"); + + ZeroMemory(&I2CArgs, sizeof(I2CArgs)); + I2CArgs.Size = sizeof(ctl_i2c_access_args_t); + I2CArgs.OpType = CTL_OPERATION_TYPE_READ; + I2CArgs.Address = 0x6E; // Address used for demonstration purpose + I2CArgs.Offset = 0x51; // Offset used for demonstration purpose + I2CArgs.DataSize = READ_SIZE_LIMIT; + + I2CArgs.Flags |= CTL_I2C_FLAG_DRIVER_OVERRIDE; // must be enabled to use the driver override I2C flags + I2CArgs.Flags |= CTL_I2C_FLAG_SPEED_BIT_BASH; // bit bash flag is required for driver override feature + + ReadDataLeft = READ_DATA_SIZE; + ReadDataSizeLimit = READ_SIZE_LIMIT; + ReadDataSent = 0; + IsFirstReadTransaction = TRUE; + + for (uint32_t i = 0; ReadDataLeft > 0; i++) + { + I2CArgs.Offset = ReadDataSent; + + if (TRUE == IsFirstReadTransaction) + { + if (ReadDataLeft <= ReadDataSizeLimit) // single read transaction: enable start and stop + { + APP_LOG_INFO("Single Transaction"); + I2CArgs.DataSize = ReadDataLeft; + I2CArgs.Flags |= CTL_I2C_FLAG_START; + I2CArgs.Flags |= CTL_I2C_FLAG_STOP; + } + else // first read transaction: enable start, disable stop + { + APP_LOG_INFO("First Transaction: %i", i + 1); + I2CArgs.DataSize = ReadDataSizeLimit; + I2CArgs.Flags |= CTL_I2C_FLAG_START; + I2CArgs.Flags &= ~CTL_I2C_FLAG_STOP; + } + + IsFirstReadTransaction = FALSE; + } + else + { + if (ReadDataLeft <= ReadDataSizeLimit) // last read transaction: disable start, enable stop + { + APP_LOG_INFO("Last Transaction: %i", i + 1); + I2CArgs.DataSize = ReadDataLeft; + I2CArgs.Flags &= ~CTL_I2C_FLAG_START; + I2CArgs.Flags |= CTL_I2C_FLAG_STOP; + } + else // middle range read transaction: disable start and stop + { + APP_LOG_INFO("Middle Range Transaction: %i", i + 1); + I2CArgs.Flags &= ~CTL_I2C_FLAG_START; + I2CArgs.Flags &= ~CTL_I2C_FLAG_STOP; + } + } + + memset(I2CArgs.Data, 0xFF, I2CArgs.DataSize); // Clear the data buffer before reading + + Result = ctlI2CAccess(hDisplayOutput, &I2CArgs); + LOG_AND_EXIT_ON_ERROR(Result, "ctlI2CAccess for I2C Read Transaction Test using I2C driver override flags"); + + // Print the data + for (uint32_t j = 0; j < I2CArgs.DataSize; j++) + { + APP_LOG_INFO("Read data[%d] = : 0x%X", j, I2CArgs.Data[j]); + } + + ReadDataSent += I2CArgs.DataSize; + ReadDataLeft -= I2CArgs.DataSize; + } + +Exit: + return Result; +} + +/*************************************************************** + * @brief TestI2CAccessWithRestartDriverOverrideFlag + * Reference code to show how to use the I2C Restart driver override flag for HDMI displays + * @param hDisplayOutput + * @return ctl_result_t + ***************************************************************/ +ctl_result_t TestI2CAccessWithRestartDriverOverrideFlag(ctl_display_output_handle_t hDisplayOutput) +{ + ctl_result_t Result = CTL_RESULT_SUCCESS; + ctl_i2c_access_args_t I2CArgs = { 0 }; // I2C Access + + // I2C WRITE : 82 01 10 AC at address 6E and subaddress 51 + // If we write these BYTEs ( 82 01 10 AC) to address 6E and + // subaddress 51, it should update the current brightness to the 10th + // byte at address 6E and subaddress 51. One can verify by changing + // panel brightness from panel buttons, writing to address 6E + // and subaddress 51 ( 82 01 10 AC), and then reading 10th byte at + // address 6E and subaddress 51. Here is an example of an 11 byte output: + // 6E 88 02 00 10 00 00 64 00 19 D9. The 10th byte value is the current brightness value of the + // panel. To confirm whether this value is correct or not, convert the Hex + // value to Decimal. In this example, the 10th byte is 0x19, which represents 25% panel brightness. + I2CArgs.Size = sizeof(ctl_i2c_access_args_t); + I2CArgs.OpType = CTL_OPERATION_TYPE_WRITE; + I2CArgs.Address = 0x6E; // Address used for demonstration purpose + I2CArgs.Offset = 0x51; // Offset used for demonstration purpose + I2CArgs.DataSize = 4; + I2CArgs.Data[0] = 0x82; + I2CArgs.Data[1] = 0x01; + I2CArgs.Data[2] = 0x10; + I2CArgs.Data[3] = 0xAC; + + EXIT_ON_MEM_ALLOC_FAILURE(hDisplayOutput, "hDisplayOutput"); + + APP_LOG_INFO("I2C Write Test using I2C Restart driver override flag for read"); + + I2CArgs.Flags |= CTL_I2C_FLAG_DRIVER_OVERRIDE; // must be enabled to use the driver override I2C flags + I2CArgs.Flags |= CTL_I2C_FLAG_SPEED_BIT_BASH; // bit bash flag is required for driver override feature + I2CArgs.Flags |= CTL_I2C_FLAG_START; // enable start flag for the write operation + + Result = ctlI2CAccess(hDisplayOutput, &I2CArgs); + + if (CTL_RESULT_SUCCESS != Result) + { + APP_LOG_ERROR("ctlI2CAccess for I2C write returned failure code: 0x%X", Result); + STORE_AND_RESET_ERROR(Result); + } + + // I2C READ : 82 01 10 AC at address 6E and subaddress 51 + APP_LOG_INFO("I2C Read Transaction Test using I2C Restart driver override flag for read"); + + ZeroMemory(&I2CArgs, sizeof(I2CArgs)); + I2CArgs.Size = sizeof(ctl_i2c_access_args_t); + I2CArgs.OpType = CTL_OPERATION_TYPE_READ; + I2CArgs.Address = 0x6E; // Address used for demonstration purpose + I2CArgs.Offset = 0x51; // Offset used for demonstration purpose + I2CArgs.DataSize = 11; + + // Perform I2C repeated start transaction for read by enabling Restart flag + I2CArgs.Flags |= CTL_I2C_FLAG_DRIVER_OVERRIDE; // must be enabled to use the driver override I2C flags + I2CArgs.Flags |= CTL_I2C_FLAG_SPEED_BIT_BASH; // bit bash flag is required for driver override feature + I2CArgs.Flags |= CTL_I2C_FLAG_RESTART; // enable restart flag for the read operation + I2CArgs.Flags |= CTL_I2C_FLAG_STOP; // issue a stop after the read operation is completed + + memset(I2CArgs.Data, 0xFF, I2CArgs.DataSize); // Clear the data buffer before reading + + Result = ctlI2CAccess(hDisplayOutput, &I2CArgs); + LOG_AND_EXIT_ON_ERROR(Result, "ctlI2CAccess for I2C read with Restart flag"); + + // Print the data + for (uint32_t j = 0; j < I2CArgs.DataSize; j++) + { + APP_LOG_INFO("Read data[%d] = : 0x%X", j, I2CArgs.Data[j]); + } + +Exit: + return Result; +} + /*************************************************************** * @brief Tests I2C Access on enumerated Pin Pairs. * Reference code to use ctlI2CAccessOnPinPair API @@ -241,6 +446,22 @@ ctl_result_t EnumerateDisplayHandles(ctl_display_output_handle_t *hDisplayOutput Result = TestI2CAUXAccess(hDisplayOutput[DisplayIndex]); STORE_AND_RESET_ERROR(Result); + + ctl_adapter_display_encoder_properties_t stDisplayEncoderProperties = {}; + stDisplayEncoderProperties.Size = sizeof(ctl_adapter_display_encoder_properties_t); + + Result = ctlGetAdaperDisplayEncoderProperties(hDisplayOutput[DisplayIndex], &stDisplayEncoderProperties); + LOG_AND_EXIT_ON_ERROR(Result, "ctlGetAdaperDisplayEncoderProperties"); + + // Currently the driver override flags are limited to HDMI only + if (CTL_DISPLAY_OUTPUT_TYPES_HDMI == stDisplayEncoderProperties.Type) + { + Result = TestI2CAccessWithDriverOverrideFlagsForMultipleReadTransactions(hDisplayOutput[DisplayIndex]); + STORE_AND_RESET_ERROR(Result); + + Result = TestI2CAccessWithRestartDriverOverrideFlag(hDisplayOutput[DisplayIndex]); + STORE_AND_RESET_ERROR(Result); + } } Exit: diff --git a/Samples/Overclocking_Sample/Sample_OverclockAPP.cpp b/Samples/Overclocking_Sample/Sample_OverclockAPP.cpp index b32e200..39918ec 100644 --- a/Samples/Overclocking_Sample/Sample_OverclockAPP.cpp +++ b/Samples/Overclocking_Sample/Sample_OverclockAPP.cpp @@ -582,7 +582,7 @@ void OverclockTemperatureLimit(ctl_device_adapter_handle_t hDAhandle) // Step 3: Writing New Temperature Limit by increasing it by (Step * 5.0) from min value // Input Temperature Limit units are given in ctl_oc_properties_t::temperatureLimit::units returned from ctlOverclockGetProperties() - // Currently ctl_oc_properties_t::temperatureLimit::units for Alchemist are CTL_UNITS_TEMPERATURE_CELSIUS units, for Battlemage are CTL_UNITS_PERCENT units + // Currently ctl_oc_properties_t::temperatureLimit::units for Alchemist and BMG G31 are CTL_UNITS_TEMPERATURE_CELSIUS units, for Battlemage (excluding G31) are CTL_UNITS_PERCENT units CurrentTemperatureLimit = OcProperties.temperatureLimit.min + (OcProperties.temperatureLimit.step * 5.0); Status = ctlOverclockTemperatureLimitSetV2(hDAhandle, CurrentTemperatureLimit); if (Status != ctl_result_t::CTL_RESULT_SUCCESS) diff --git a/Samples/inc/GenericIGCLApp.h b/Samples/inc/GenericIGCLApp.h index d99de21..b7d1012 100644 --- a/Samples/inc/GenericIGCLApp.h +++ b/Samples/inc/GenericIGCLApp.h @@ -445,3 +445,62 @@ inline void Print3DFeatureDetail(ctl_3d_feature_details_t *pFeatureDetails) } } } + +// Helper function to print ctl_std_display_feature_flags_t flags +void PrintStdDisplayFeatureFlags(ctl_std_display_feature_flags_t flags) +{ + printf("ctl_std_display_feature_flags_t: 0x%X\n", flags); + + // Example flag values, replace/add with actual flag definitions as needed + struct FlagInfo + { + ctl_std_display_feature_flags_t value; + const char *name; + }; + + static const FlagInfo flagInfos[] = { + { 0x00000001, "CTL_STD_DISPLAY_FEATURE_FLAG_HDCP" }, + { 0x00000002, "CTL_STD_DISPLAY_FEATURE_FLAG_HD_AUDIO" }, + { 0x00000004, "CTL_STD_DISPLAY_FEATURE_FLAG_PSR" }, + { 0x00000008, "CTL_STD_DISPLAY_FEATURE_FLAG_ADAPTIVESYNC_VRR" }, + { 0x00000010, "CTL_STD_DISPLAY_FEATURE_FLAG_VESA_COMPRESSION" }, + { 0x00000020, "CTL_STD_DISPLAY_FEATURE_FLAG_HDR" }, + { 0x00000040, "CTL_STD_DISPLAY_FEATURE_FLAG_HDMI_QMS" }, + { 0x00000080, "CTL_STD_DISPLAY_FEATURE_FLAG_HDR10_PLUS_CERTIFIED" }, + { 0x00000100, "CTL_STD_DISPLAY_FEATURE_FLAG_VESA_HDR_CERTIFIED" }, + // Add more flag definitions here as needed + }; + + for (const auto &info : flagInfos) + { + if (flags & info.value) + { + printf(" %s\n", info.name); + } + } +} + +void PrintIntelDisplayFeatureFlags(ctl_intel_display_feature_flags_t flags) +{ + printf("ctl_intel_display_feature_flags_t: 0x%X\n", flags); + // Example flag values, replace/add with actual flag definitions as needed + struct FlagInfo + { + ctl_intel_display_feature_flags_t value; + const char *name; + }; + static const FlagInfo flagInfos[] = { + { 0x00000001, "CTL_INTEL_DISPLAY_FEATURE_FLAG_DPST" }, + { 0x00000002, "CTL_INTEL_DISPLAY_FEATURE_FLAG_LACE" }, + { 0x00000004, "CTL_INTEL_DISPLAY_FEATURE_FLAG_DRRS" }, + { 0x00000008, "CTL_INTEL_DISPLAY_FEATURE_FLAG_ARC_ADAPTIVE_SYNC_CERTIFIED" }, + // Add more flag definitions here as needed + }; + for (const auto &info : flagInfos) + { + if (flags & info.value) + { + printf(" %s\n", info.name); + } + } +} diff --git a/Source/cApiWrapper.cpp b/Source/cApiWrapper.cpp index 5af1d6c..71803a7 100644 --- a/Source/cApiWrapper.cpp +++ b/Source/cApiWrapper.cpp @@ -890,7 +890,8 @@ ctlSetCurrentSharpness( * @brief I2C Access * * @details -* - Interface to access I2C using display handle as identifier. +* - Interface to access I2C using display handle as identifier. I2C +* driver override flags are supported only for HDMI displays. * * @returns * - CTL_RESULT_SUCCESS diff --git a/include/igcl_api.h b/include/igcl_api.h index 06f3571..7b1babc 100644 --- a/include/igcl_api.h +++ b/include/igcl_api.h @@ -2540,6 +2540,10 @@ typedef enum _ctl_i2c_flag_t CTL_I2C_FLAG_SPEED_FAST = CTL_BIT(5), ///< If no Speed Flag is set, defaults to Best Option possible. CTL_I2C_FLAG_SPEED_BIT_BASH = CTL_BIT(6), ///< Uses Slower access using SW bit bashing method. If no Speed Flag is ///< set, defaults to Best Option possible. + CTL_I2C_FLAG_DRIVER_OVERRIDE = CTL_BIT(7), ///< If set, overrides the driver I2C flags with those provided by IGCL + CTL_I2C_FLAG_START = CTL_BIT(8), ///< I2C Start driver override flag + CTL_I2C_FLAG_STOP = CTL_BIT(9), ///< I2C Stop driver override flags + CTL_I2C_FLAG_RESTART = CTL_BIT(10), ///< I2C Restart driver override flag CTL_I2C_FLAG_MAX = 0x80000000 } ctl_i2c_flag_t; @@ -2566,7 +2570,8 @@ typedef struct _ctl_i2c_access_args_t /// @brief I2C Access /// /// @details -/// - Interface to access I2C using display handle as identifier. +/// - Interface to access I2C using display handle as identifier. I2C +/// driver override flags are supported only for HDMI displays. /// /// @returns /// - CTL_RESULT_SUCCESS