XilinxProcessorIPLib/drivers/v_hdmirxss/src/xv_hdmirxss_hdcp.c
int XV_HdmiRxSs_HdcpEnable(XV_HdmiRxSs *InstancePtr)
{
  /* Verify argument. */
  Xil_AssertNonvoid(InstancePtr != NULL);

  int Status1 = XST_SUCCESS;
  int Status2 = XST_SUCCESS;

  switch (InstancePtr->HdcpProtocol) {

    /* Disable HDCP 1.4 and HDCP 2.2 */
    case XV_HDMIRXSS_HDCP_NONE :
#ifdef XPAR_XHDCP_NUM_INSTANCES
      if (InstancePtr->Hdcp14Ptr) {
        Status1 = XHdcp1x_Disable(InstancePtr->Hdcp14Ptr);
        XHdcp1x_Poll(InstancePtr->Hdcp14Ptr); // This is needed to ensure that the previous command is executed.
#ifdef XV_HDMIRXSS_LOG_ENABLE
        XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_HDCP14, 0);
#endif
      }
#endif
#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
      if (InstancePtr->Hdcp22Ptr) {
        Status2 = XHdcp22Rx_Disable(InstancePtr->Hdcp22Ptr);
#ifdef XV_HDMIRXSS_LOG_ENABLE
        XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_HDCP22, 0);
#endif
      }
#endif
      break;

    /* Enable HDCP 1.4 and disable HDCP 2.2 */
    case XV_HDMIRXSS_HDCP_14 :
#ifdef XPAR_XHDCP_NUM_INSTANCES
      if (InstancePtr->Hdcp14Ptr) {
        Status1 = XHdcp1x_Enable(InstancePtr->Hdcp14Ptr);
        XHdcp1x_Poll(InstancePtr->Hdcp14Ptr); // This is needed to ensure that the previous command is executed.
#ifdef XV_HDMIRXSS_LOG_ENABLE
        XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_HDCP14, 1);
#endif
      }
      else {
        Status1 = XST_FAILURE;
      }

      /* Set DDC peripheral to HDCP 1.4 mode */
      XV_HdmiRx_DdcHdcp14Mode(InstancePtr->HdmiRxPtr);
#else
      Status1 = XST_FAILURE;
#endif
#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
      if (InstancePtr->Hdcp22Ptr) {
        Status2 = XHdcp22Rx_Disable(InstancePtr->Hdcp22Ptr);
#ifdef XV_HDMIRXSS_LOG_ENABLE
        XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_HDCP22, 0);
#endif
      }
#endif
      break;

    /* Enable HDCP 2.2 and disable HDCP 1.4 */
    case XV_HDMIRXSS_HDCP_22 :
#ifdef XPAR_XHDCP_NUM_INSTANCES
      if (InstancePtr->Hdcp14Ptr) {
        Status1 = XHdcp1x_Disable(InstancePtr->Hdcp14Ptr);
        XHdcp1x_Poll(InstancePtr->Hdcp14Ptr); // This is needed to ensure that the previous command is executed.
#ifdef XV_HDMIRXSS_LOG_ENABLE
        XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_HDCP14, 0);
#endif
      }
#endif
#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
      if (InstancePtr->Hdcp22Ptr) {
        Status2 = XHdcp22Rx_Enable(InstancePtr->Hdcp22Ptr);
#ifdef XV_HDMIRXSS_LOG_ENABLE
        XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_HDCP22, 1);
#endif
      }
      else {
        Status2 = XST_FAILURE;
      }

      /* Set DDC peripheral to HDCP 2.2 mode */
      XV_HdmiRx_DdcHdcp22Mode(InstancePtr->HdmiRxPtr);
#else
      Status2 = XST_FAILURE;
#endif
      break;

    default :
      return XST_FAILURE;
  }

  return (Status1 == XST_SUCCESS && Status2 == XST_SUCCESS) ? XST_SUCCESS : XST_FAILURE;
}
/*****************************************************************************/
/**
*
* This function enables the requested HDCP protocol. This function
* ensures that the HDCP protocols are mutually exclusive such that
* either HDCP 1.4 or HDCP 2.2 is enabled and active at any given time.
* When the protocol is set to None, both HDCP protocols are disabled.
*
* @param InstancePtr is a pointer to the XV_HdmiRxSs instance.
*
* @return
*  - XST_SUCCESS if action was successful
*  - XST_FAILURE if action was not successful
*
* @note   None.
*
******************************************************************************/
This function enables the requested HDCP protocol. This function
ensures that the HDCP protocols are mutually exclusive such that
either HDCP 1.4 or HDCP 2.2 is enabled and active at any given time.
When the protocol is set to None, both HDCP protocols are disabled.
This function enables the requested HDCP protocol . This function ensures that the HDCP protocols are mutually exclusive such that either HDCP 1 . 4 or HDCP 2 . 2 is enabled and active at any given time . When the protocol is set to None both HDCP protocols are disabled .
int XV_HdmiRxSs_HdcpEnable(XV_HdmiRxSs *InstancePtr)
{
  Xil_AssertNonvoid(InstancePtr != NULL);
  int Status1 = XST_SUCCESS;
  int Status2 = XST_SUCCESS;
  switch (InstancePtr->HdcpProtocol) {
    case XV_HDMIRXSS_HDCP_NONE :
#ifdef XPAR_XHDCP_NUM_INSTANCES
      if (InstancePtr->Hdcp14Ptr) {
        Status1 = XHdcp1x_Disable(InstancePtr->Hdcp14Ptr);
        XHdcp1x_Poll(InstancePtr->Hdcp14Ptr); 
#ifdef XV_HDMIRXSS_LOG_ENABLE
        XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_HDCP14, 0);
#endif
      }
#endif
#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
      if (InstancePtr->Hdcp22Ptr) {
        Status2 = XHdcp22Rx_Disable(InstancePtr->Hdcp22Ptr);
#ifdef XV_HDMIRXSS_LOG_ENABLE
        XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_HDCP22, 0);
#endif
      }
#endif
      break;
    case XV_HDMIRXSS_HDCP_14 :
#ifdef XPAR_XHDCP_NUM_INSTANCES
      if (InstancePtr->Hdcp14Ptr) {
        Status1 = XHdcp1x_Enable(InstancePtr->Hdcp14Ptr);
        XHdcp1x_Poll(InstancePtr->Hdcp14Ptr); 
#ifdef XV_HDMIRXSS_LOG_ENABLE
        XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_HDCP14, 1);
#endif
      }
      else {
        Status1 = XST_FAILURE;
      }
      XV_HdmiRx_DdcHdcp14Mode(InstancePtr->HdmiRxPtr);
#else
      Status1 = XST_FAILURE;
#endif
#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
      if (InstancePtr->Hdcp22Ptr) {
        Status2 = XHdcp22Rx_Disable(InstancePtr->Hdcp22Ptr);
#ifdef XV_HDMIRXSS_LOG_ENABLE
        XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_HDCP22, 0);
#endif
      }
#endif
      break;
    case XV_HDMIRXSS_HDCP_22 :
#ifdef XPAR_XHDCP_NUM_INSTANCES
      if (InstancePtr->Hdcp14Ptr) {
        Status1 = XHdcp1x_Disable(InstancePtr->Hdcp14Ptr);
        XHdcp1x_Poll(InstancePtr->Hdcp14Ptr); 
#ifdef XV_HDMIRXSS_LOG_ENABLE
        XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_HDCP14, 0);
#endif
      }
#endif
#ifdef XPAR_XHDCP22_RX_NUM_INSTANCES
      if (InstancePtr->Hdcp22Ptr) {
        Status2 = XHdcp22Rx_Enable(InstancePtr->Hdcp22Ptr);
#ifdef XV_HDMIRXSS_LOG_ENABLE
        XV_HdmiRxSs_LogWrite(InstancePtr, XV_HDMIRXSS_LOG_EVT_HDCP22, 1);
#endif
      }
      else {
        Status2 = XST_FAILURE;
      }
      XV_HdmiRx_DdcHdcp22Mode(InstancePtr->HdmiRxPtr);
#else
      Status2 = XST_FAILURE;
#endif
      break;
    default :
      return XST_FAILURE;
  }
  return (Status1 == XST_SUCCESS && Status2 == XST_SUCCESS) ? XST_SUCCESS : XST_FAILURE;
}
int XV_HdmiRxSs_HdcpEnable ( XV_HdmiRxSs * InstancePtr ) { Xil_AssertNonvoid ( InstancePtr != NULL ) ; int Status1 = XST_SUCCESS ; int Status2 = XST_SUCCESS ; switch ( InstancePtr -> HdcpProtocol ) { case XV_HDMIRXSS_HDCP_NONE : #ifdef XPAR_XHDCP_NUM_INSTANCES if ( InstancePtr -> Hdcp14Ptr ) { Status1 = XHdcp1x_Disable ( InstancePtr -> Hdcp14Ptr ) ; XHdcp1x_Poll ( InstancePtr -> Hdcp14Ptr ) ; #ifdef XV_HDMIRXSS_LOG_ENABLE XV_HdmiRxSs_LogWrite ( InstancePtr , XV_HDMIRXSS_LOG_EVT_HDCP14 , 0 ) ; #endif } #endif #ifdef XPAR_XHDCP22_RX_NUM_INSTANCES if ( InstancePtr -> Hdcp22Ptr ) { Status2 = XHdcp22Rx_Disable ( InstancePtr -> Hdcp22Ptr ) ; #ifdef XV_HDMIRXSS_LOG_ENABLE XV_HdmiRxSs_LogWrite ( InstancePtr , XV_HDMIRXSS_LOG_EVT_HDCP22 , 0 ) ; #endif } #endif break ; case XV_HDMIRXSS_HDCP_14 : #ifdef XPAR_XHDCP_NUM_INSTANCES if ( InstancePtr -> Hdcp14Ptr ) { Status1 = XHdcp1x_Enable ( InstancePtr -> Hdcp14Ptr ) ; XHdcp1x_Poll ( InstancePtr -> Hdcp14Ptr ) ; #ifdef XV_HDMIRXSS_LOG_ENABLE XV_HdmiRxSs_LogWrite ( InstancePtr , XV_HDMIRXSS_LOG_EVT_HDCP14 , 1 ) ; #endif } else { Status1 = XST_FAILURE ; } XV_HdmiRx_DdcHdcp14Mode ( InstancePtr -> HdmiRxPtr ) ; #else Status1 = XST_FAILURE ; #endif #ifdef XPAR_XHDCP22_RX_NUM_INSTANCES if ( InstancePtr -> Hdcp22Ptr ) { Status2 = XHdcp22Rx_Disable ( InstancePtr -> Hdcp22Ptr ) ; #ifdef XV_HDMIRXSS_LOG_ENABLE XV_HdmiRxSs_LogWrite ( InstancePtr , XV_HDMIRXSS_LOG_EVT_HDCP22 , 0 ) ; #endif } #endif break ; case XV_HDMIRXSS_HDCP_22 : #ifdef XPAR_XHDCP_NUM_INSTANCES if ( InstancePtr -> Hdcp14Ptr ) { Status1 = XHdcp1x_Disable ( InstancePtr -> Hdcp14Ptr ) ; XHdcp1x_Poll ( InstancePtr -> Hdcp14Ptr ) ; #ifdef XV_HDMIRXSS_LOG_ENABLE XV_HdmiRxSs_LogWrite ( InstancePtr , XV_HDMIRXSS_LOG_EVT_HDCP14 , 0 ) ; #endif } #endif #ifdef XPAR_XHDCP22_RX_NUM_INSTANCES if ( InstancePtr -> Hdcp22Ptr ) { Status2 = XHdcp22Rx_Enable ( InstancePtr -> Hdcp22Ptr ) ; #ifdef XV_HDMIRXSS_LOG_ENABLE XV_HdmiRxSs_LogWrite ( InstancePtr , XV_HDMIRXSS_LOG_EVT_HDCP22 , 1 ) ; #endif } else { Status2 = XST_FAILURE ; } XV_HdmiRx_DdcHdcp22Mode ( InstancePtr -> HdmiRxPtr ) ; #else Status2 = XST_FAILURE ; #endif break ; default : return XST_FAILURE ; } return ( Status1 == XST_SUCCESS && Status2 == XST_SUCCESS ) ? XST_SUCCESS : XST_FAILURE ; }
This function enables the requested HDCP protocol.
This function enables the requested HDCP protocol .
/* Verify argument. */ /* Disable HDCP 1.4 and HDCP 2.2 */ // This is needed to ensure that the previous command is executed. /* Enable HDCP 1.4 and disable HDCP 2.2 */ // This is needed to ensure that the previous command is executed. /* Set DDC peripheral to HDCP 1.4 mode */ /* Enable HDCP 2.2 and disable HDCP 1.4 */ // This is needed to ensure that the previous command is executed. /* Set DDC peripheral to HDCP 2.2 mode */