diff --git a/software/sys_controller/it6613/HDMI_TX.c b/software/sys_controller/it6613/HDMI_TX.c index 9d262f0..57241d7 100644 --- a/software/sys_controller/it6613/HDMI_TX.c +++ b/software/sys_controller/it6613/HDMI_TX.c @@ -360,5 +360,27 @@ void HDMITX_SetHDRInfoFrame(BYTE HDR_TF) HDRInfo.pktbyte.HDR_DB[24] = 0xfa; HDRInfo.pktbyte.HDR_DB[25] = 0x00;*/ - EnableHDRInfoFrame(TRUE, (BYTE *) &HDRInfo); + EnableGPInfoFrame(TRUE, (BYTE *) &HDRInfo); } + +void HDMITX_SetVRRInfoFrame(BYTE enable) +{ + int i; + Freesync_InfoFrame VRRInfo; + + VRRInfo.info.Type = SPD_INFOFRAME_TYPE; + VRRInfo.info.Ver = VENDORSPEC_INFOFRAME_VER; + VRRInfo.info.Len = VENDORSPEC_INFOFRAME_LEN; + + VRRInfo.info.Enable = enable ? 0x1a : 0; + VRRInfo.info.Mode2 = 0x07; + VRRInfo.info.min_rate = 40; + VRRInfo.info.max_rate = 144; + + for (i=1; iinfo.Type)); - HDMITX_WriteI2C_Byte(REG_TX_PKT_HB01, pHDRInfoFrame->info.Ver); - HDMITX_WriteI2C_Byte(REG_TX_PKT_HB02, pHDRInfoFrame->info.Len); + HDMITX_WriteI2C_Byte(REG_TX_PKT_HB00, (0x80+pInfoFrame->info.Type)); + HDMITX_WriteI2C_Byte(REG_TX_PKT_HB01, pInfoFrame->info.Ver); + HDMITX_WriteI2C_Byte(REG_TX_PKT_HB02, pInfoFrame->info.Len); - for(i = 0,ucData = 0 ; i< HDR_INFOFRAME_LEN ; i++) + for(i = 0,ucData = 0 ; i< pInfoFrame->info.Len ; i++) { - HDMITX_WriteI2C_Byte(REG_TX_PKT_PB01+i, pHDRInfoFrame->pktbyte.HDR_DB[i]); - ucData -= pHDRInfoFrame->pktbyte.HDR_DB[i] ; + HDMITX_WriteI2C_Byte(REG_TX_PKT_PB01+i, pInfoFrame->pktbyte.HDR_DB[i]); + ucData -= pInfoFrame->pktbyte.HDR_DB[i] ; } - ucData -= 0x80+HDR_INFOFRAME_VER+HDR_INFOFRAME_TYPE+HDR_INFOFRAME_LEN ; + ucData -= 0x80+pInfoFrame->info.Type+pInfoFrame->info.Ver+pInfoFrame->info.Len ; HDMITX_WriteI2C_Byte(REG_TX_PKT_PB00, ucData); Switch_HDMITX_Bank(0) ; diff --git a/software/sys_controller/it6613/it6613_drv.h b/software/sys_controller/it6613/it6613_drv.h index 36e297b..ea00c4f 100644 --- a/software/sys_controller/it6613/it6613_drv.h +++ b/software/sys_controller/it6613/it6613_drv.h @@ -828,7 +828,7 @@ BOOL CheckHDMITX(BYTE *pHPD,BYTE *pHPDChange) ; BOOL EnableHDCP(BYTE bEnable) ; BOOL EnableAVIInfoFrame(BYTE bEnable,BYTE *pAVIInfoFrame); BOOL EnableAudioInfoFrame(BYTE bEnable,BYTE *pAudioInfoFrame); -BOOL EnableHDRInfoFrame(BYTE bEnable, BYTE *pHDRInfoFrame); +BOOL EnableGPInfoFrame(BYTE bEnable, BYTE *pInfoFrame); // BOOL EnableVideoOutputIndirect(BYTE xCnt,BYTE inputColorMode,BYTE outputColorMode,BYTE bHDMI) ; void SetAVMute(BYTE bEnable) ; void SetOutputColorDepthPhase(BYTE ColorDepth,BYTE bPhase) ; diff --git a/software/sys_controller/it6613/typedef.h b/software/sys_controller/it6613/typedef.h index 376c6d9..1fed05b 100644 --- a/software/sys_controller/it6613/typedef.h +++ b/software/sys_controller/it6613/typedef.h @@ -252,6 +252,33 @@ typedef union _AVI_InfoFrame } pktbyte ; } AVI_InfoFrame ; +typedef union _Freesync_InfoFrame { + + struct { + BYTE Type ; + BYTE Ver ; + BYTE Len ; + + BYTE Enable ; + + BYTE Rsvd1 ; + BYTE Rsvd2 ; + BYTE Rsvd3 ; + BYTE Rsvd4 ; + + BYTE Mode2 ; + + BYTE min_rate ; + BYTE max_rate ; + } info ; + + struct { + BYTE FS_HB[3] ; + BYTE FS_DB[VENDORSPEC_INFOFRAME_LEN] ; + } pktbyte ; + +} Freesync_InfoFrame ; + typedef union _Audio_InfoFrame { struct {