📄 dp_api_query_functions.c
字号:
* identified.
*
* pbConversionEnabled - A pointer to a flag which the function will use to
* indicate whether colour space conversion is
* currently enabled for the specified plane. Following
* successful execution of the function, if the flag is
* set to 'DP_TRUE' then colour space conversion is
* currently enabled for the specified plane. If the
* flag is set to 'DP_FALSE', then colour space
* conversion is currently disabled for the specified
* plane.
*
* peConversionMode - If the 'pbConversionEnabled' flag is returned set
* to 'DP_TRUE', then the enumerated type pointed to by
* this parameter is set to the current colour space
* conversion mode. See API specification for details
* on enumerated types.
*
* Outputs : pbConversionEnabled - See above.
*
* peConversionMode - See above.
*
* Returns : DP_UINT_16 - Returns one of the defined display pipeline error
* codes, according to the success of the function and
* whether the compiler directive DP_ERROR_CHECKING
* is enabled. See API specification for more details
* on error types.
*
* Description : This function is used to establish whether the specified plane is currently
* using colour space conversion and, if it is, what method of colour space
* conversion it is using.
*
***********************************************************************************************/
DP_UINT_16 DP_GetColourSpaceConversion ( DP_UINT_16 ui16PlaneHandle,
DP_PBOOL pbConversionEnabled,
DP_ColourSpaceConversionModes * peConversionMode )
{
#if defined DP_ERROR_CHECKING
DP_UINT_16 ui16ReturnValue = DP_STANDARD_CODE_NO_ERROR;
#else
DP_UINT_16 ui16ReturnValue = DP_ERR_NO_ERROR_CHECKING;
#endif
DP_UINT_32 ui32FieldAsRead;
DP_UINT_16 ui16i;
#if defined DP_SIMULATION_MODE
printf ("\n DP_GetColourSpaceConversion \n");
#endif
#if defined DP_ERROR_CHECKING
if ( !DP_bIsPipelineInitialised )
ui16ReturnValue = DP_ERR_NOT_INITIALISED;
else if ( ui16PlaneHandle > DP_NO_OF_STREAMS )
ui16ReturnValue = DP_ERR_UNKNOWN_PLANE;
/* else if.... (other tests here) */
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
/* Read the field value */
ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][ DP_STREAM_SPECIFIC_FIELD_COLOUR_SPACE_CONVERSION_ENABLED ],
&ui16ReturnValue );
#if defined DP_ERROR_CHECKING
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
*pbConversionEnabled = (DP_BOOL) (ui32FieldAsRead & 0x01);
if ( pbConversionEnabled )
{
/* Read the field value */
ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][DP_STREAM_SPECIFIC_FIELD_COLOUR_SPACE_CONVERSION_MODE],
&ui16ReturnValue );
#if defined DP_ERROR_CHECKING
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
/* Find out if the field value corresponds to any of the enumerated types */
for ( ui16i = 0; ui16i == DP_COLOUR_SPACE_CONVERSION_MODE_NUMBER_OF_MODES; ui16i++ )
{
if ( ui32FieldAsRead == DP_aui8ColourSpaceConversionModeVals [ ui16i ] )
break;
}
if ( ui16i != DP_COLOUR_SPACE_CONVERSION_MODE_NUMBER_OF_MODES )
{
*peConversionMode = (DP_ColourSpaceConversionModes) ui16i;
}
#if defined DP_ERROR_CHECKING
else
{
ui16ReturnValue = DP_ERR_UNKNOWN_MODE;
}
}
#endif
} /* If conversion enabled */
#if defined DP_ERROR_CHECKING
}
#endif
#if defined DP_ERROR_CHECKING
}
#endif
return ui16ReturnValue;
}
/***********************************************************************************************
*
* Function Name : DP_GetDisplayEnable
* Inputs : peDisplayActive - A pointer to a DP_DisplayActiveSettings enumeration,
* which the function will set according to the current
* power setting of the display pipeline.
*
* Outputs : peDisplayActive - See above.
* Returns : DP_UINT_16 - Returns one of the defined display pipeline error
* codes, according to the success of the function and
* whether the compiler directive DP_ERROR_CHECKING
* is enabled. See API specification for more details
* on error types.
*
* Description : This function is used to establish whether the main (output) frame is
* currently turned on or off and whether power saving is enabled.
*
***********************************************************************************************/
DP_UINT_16 DP_GetDisplayEnable ( DP_DisplayActiveSettings * peDisplayActive )
{
#if defined DP_ERROR_CHECKING
DP_UINT_16 ui16ReturnValue = DP_STANDARD_CODE_NO_ERROR;
#else
DP_UINT_16 ui16ReturnValue = DP_ERR_NO_ERROR_CHECKING;
#endif
DP_UINT_32 ui32FieldAsRead;
DP_BOOL bSyncActive, bMemFetchesPoweredDown;
#if defined DP_SIMULATION_MODE
printf ("\n DP_GetDisplayEnable \n");
#endif
#if defined DP_ERROR_CHECKING
if ( !DP_bIsPipelineInitialised )
ui16ReturnValue = DP_ERR_NOT_INITIALISED;
/* else if.... (other tests here) */
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
/* Read the field value */
ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asGlobalFieldTargets [ DP_GLOBAL_FIELD_CONTROL_SYNC_ACTIVE ],
&ui16ReturnValue );
bSyncActive = (DP_BOOL) (ui32FieldAsRead & 0x01);
#if defined DP_ERROR_CHECKING
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asGlobalFieldTargets [ DP_GLOBAL_FIELD_CONTROL_POWER_DOWN_MODE ],
&ui16ReturnValue );
bMemFetchesPoweredDown = (DP_BOOL) (ui32FieldAsRead & 0x01);
#if defined DP_ERROR_CHECKING
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
if ( !bSyncActive && bMemFetchesPoweredDown )
*peDisplayActive = DP_DISPLAY_FULLY_POWERED_DOWN;
else if ( bSyncActive && bMemFetchesPoweredDown )
*peDisplayActive = DP_DISPLAY_PARTIALLY_POWERED_DOWN;
else if ( bSyncActive && !bMemFetchesPoweredDown )
*peDisplayActive = DP_DISPLAY_ENABLED;
else
ui16ReturnValue = DP_ERR_UNKNOWN_MODE;
#if defined DP_ERROR_CHECKING
}
#endif
#if defined DP_ERROR_CHECKING
}
#endif
#if defined DP_ERROR_CHECKING
}
#endif
return ui16ReturnValue;
}
/***********************************************************************************************
*
* Function Name : DP_GetGammaEnable
* Inputs : ui16PlaneHandle - The handle by which the plane to be used is
* identified.
*
* pbGammaEnabled - A pointer to a flag which the function will use to
* indicate whether gamma correction is currently
* enabled for the specified plane. Following
* successful operation of the function, if this flag
* is set to 'DP_TRUE', then gamma correction is
* currently being applied to the specified plane. If
* the flag is set to 'DP_FALSE', then gamma correction
* is not currently being applied to the specified
* plane.
*
* Outputs : pbGammaEnabled - See above.
*
* Returns : DP_UINT_16 - Returns one of the defined display pipeline error
* codes, according to the success of the function and
* whether the compiler directive DP_ERROR_CHECKING
* is enabled. See API specification for more details
* on error types.
*
* Description : This function is used to establish whether gamma correction is currently
* being applied to the specified plane.
*
***********************************************************************************************/
DP_UINT_16 DP_GetGammaEnable ( DP_UINT_16 ui16PlaneHandle,
DP_PBOOL pbGammaEnabled )
{
#if defined DP_ERROR_CHECKING
DP_UINT_16 ui16ReturnValue = DP_STANDARD_CODE_NO_ERROR;
#else
DP_UINT_16 ui16ReturnValue = DP_ERR_NO_ERROR_CHECKING;
#endif
DP_UINT_32 ui32FieldAsRead;
#if defined DP_SIMULATION_MODE
printf ("\n DP_GetGammaEnable \n");
#endif
#if defined DP_ERROR_CHECKING
if ( !DP_bIsPipelineInitialised )
ui16ReturnValue = DP_ERR_NOT_INITIALISED;
else if ( ui16PlaneHandle > DP_NO_OF_STREAMS )
ui16ReturnValue = DP_ERR_UNKNOWN_PLANE;
/* else if.... (other tests here) */
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
/* Read the field value */
ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][ DP_STREAM_SPECIFIC_FIELD_GAMMA_CORRECTION_ENABLED ],
&ui16ReturnValue );
#if defined DP_ERROR_CHECKING
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
*pbGammaEnabled = (DP_BOOL) (ui32FieldAsRead & 0x01);
#if defined DP_ERROR_CHECKING
}
#endif
#if defined DP_ERROR_CHECKING
}
#endif
return ui16ReturnValue;
}
/***********************************************************************************************
*
* Function Name : DP_GetSlavePlaneEnable
* Inputs : ui16PlaneHandle - The handle (a sixteen bit number) by which the plane
* to be used is identified.
*
* pbSlavePlaneEnabled - A pointer to a flag which the function will use to
* indicate whether the specified plane's slave plane
* is currently enabled. Following successful operation
* of the function, if this flag is set to 'DP_TRUE',
* then the specified plane's slave plane is currently
* enabled. If the flag is set to 'DP_FALSE', then the
* specified plane's slave plane is currently disabled.
*
* pui16SlavePlaneHandle- If the 'pbSlavePlaneEnabled' is returned set to
* 'DP_TRUE', then the 'DP_UINT_16' pointed to by this
* parameter will be filled with the handle of the
* specified plane's slave plane.
*
* Outputs : pbSlavePlaneEnabled - See above.
*
* pui16SlavePlaneHandle- See above.
*
* Returns : DP_UINT_16 - Returns one of the defined display pipeline error
* codes, according to the success of the function and
* whether the compiler directive DP_ERROR_CHECKING
* is enabled. See API specification for more details
* on error types.
*
* Description : This function is used to establish whether the specified plane's slave plane
* is currently enabled and, if it is, what its handle is.
*
***********************************************************************************************/
DP_UINT_16 DP_GetSlavePlaneEnable ( DP_UINT_16 ui16PlaneHandle,
DP_PBOOL pbSlavePlaneEnabled,
DP_PUINT_16 pui16SlavePlaneHandle)
{
#if defined DP_ERROR_CHECKING
DP_UINT_16 ui16ReturnValue = DP_STANDARD_CODE_NO_ERROR;
#else
DP_UINT_16 ui16ReturnValue = DP_ERR_NO_ERROR_CHECKING;
#endif
DP_UINT_32 ui32FieldAsRead;
#if defined DP_SIMULATION_MODE
printf ("\n DP_GetSlavePlaneEnable \n");
#endif
if ( DP_asStreamCapabilities [ ui16PlaneHandle ].eSlaveModeSupported != DP_SLAVE_MODE_HAS_SLAVE_PLANE )
ui16ReturnValue = DP_ERR_EXCEEDS_CAPABILITIES;
else
{
#if defined DP_ERROR_CHECKING
if ( !DP_bIsPipelineInitialised )
ui16ReturnValue = DP_ERR_NOT_INITIALISED;
else if ( ui16PlaneHandle > DP_NO_OF_STREAMS )
ui16ReturnValue = DP_ERR_UNKNOWN_PLANE;
/* else if.... (other tests here) */
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
/* Read the field value */
ui32FieldAsRead = DP_GetField ( (DP_FieldTarget *) &DP_asStreamFieldTargets [ui16PlaneHandle][ DP_STREAM_SPECIFIC_FIELD_SLAVE_PLANE_ENABLED ],
&ui16ReturnValue );
#if defined DP_ERROR_CHECKING
if ( ui16ReturnValue == DP_STANDARD_CODE_NO_ERROR)
{
#endif
*pbSlavePlaneEnabled = (DP_BOOL) (ui32FieldAsRead & 0x01);
/* Slave mode qualifier contains the handle of the slave plane */
*pui16SlavePlaneHandle = DP_asStreamCapabilities [ ui16PlaneHandle ].ui8SlaveModeQualifier;
#if defined DP_ERROR_CHECKING
}
#endif
#if defined DP_ERROR_CHECKING
}
#endif
}
return u
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -