XilinxProcessorIPLib/drivers/v_hdmitxss1/src/xv_hdmitxss1_hdcp.c
int XV_HdmiTxSs1_HdcpEnable(XV_HdmiTxSs1 *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_HDMITXSS1_HDCP_NONE :
#ifdef XPAR_XHDCP_NUM_INSTANCES
      if (InstancePtr->Hdcp14Ptr) {
        Status1 = XHdcp1x_Disable(InstancePtr->Hdcp14Ptr);
        /* This is needed to ensure that the previous command is executed.*/
        XHdcp1x_Poll(InstancePtr->Hdcp14Ptr);
      }
#endif
#ifdef XPAR_XHDCP22_TX_NUM_INSTANCES
      if (InstancePtr->Hdcp22Ptr) {
        Status2 = XHdcp22Tx_Disable(InstancePtr->Hdcp22Ptr);
      }
#endif
      break;

    /* Enable HDCP 1.4 and disable HDCP 2.2 */
    case XV_HDMITXSS1_HDCP_14 :
#ifdef XPAR_XHDCP_NUM_INSTANCES
      if (InstancePtr->Hdcp14Ptr) {
        Status1 = XHdcp1x_Enable(InstancePtr->Hdcp14Ptr);
        /* This is needed to ensure that the previous command is executed.*/
        XHdcp1x_Poll(InstancePtr->Hdcp14Ptr);
      }
      else {
        Status1 = XST_FAILURE;
      }
#else
      Status1 = XST_FAILURE;
#endif
#ifdef XPAR_XHDCP22_TX_NUM_INSTANCES
      if (InstancePtr->Hdcp22Ptr) {
        Status2 = XHdcp22Tx_Disable(InstancePtr->Hdcp22Ptr);
      }
#endif
      break;

    /* Enable HDCP 2.2 and disable HDCP 1.4 */
    case XV_HDMITXSS1_HDCP_22 :
#ifdef XPAR_XHDCP_NUM_INSTANCES
      if (InstancePtr->Hdcp14Ptr) {
        Status1 = XHdcp1x_Disable(InstancePtr->Hdcp14Ptr);
        /* This is needed to ensure that the previous command is executed.*/
        XHdcp1x_Poll(InstancePtr->Hdcp14Ptr);
      }
#endif
#ifdef XPAR_XHDCP22_TX_NUM_INSTANCES
      if (InstancePtr->Hdcp22Ptr) {
        Status2 = XHdcp22Tx_Enable(InstancePtr->Hdcp22Ptr);
      }
      else {
        Status2 = XST_FAILURE;
      }
#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_HdmiTxSs1 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_HdmiTxSs1_HdcpEnable(XV_HdmiTxSs1 *InstancePtr)
{
  Xil_AssertNonvoid(InstancePtr != NULL);
  int Status1 = XST_SUCCESS;
  int Status2 = XST_SUCCESS;
  switch (InstancePtr->HdcpProtocol) {
    case XV_HDMITXSS1_HDCP_NONE :
#ifdef XPAR_XHDCP_NUM_INSTANCES
      if (InstancePtr->Hdcp14Ptr) {
        Status1 = XHdcp1x_Disable(InstancePtr->Hdcp14Ptr);
        XHdcp1x_Poll(InstancePtr->Hdcp14Ptr);
      }
#endif
#ifdef XPAR_XHDCP22_TX_NUM_INSTANCES
      if (InstancePtr->Hdcp22Ptr) {
        Status2 = XHdcp22Tx_Disable(InstancePtr->Hdcp22Ptr);
      }
#endif
      break;
    case XV_HDMITXSS1_HDCP_14 :
#ifdef XPAR_XHDCP_NUM_INSTANCES
      if (InstancePtr->Hdcp14Ptr) {
        Status1 = XHdcp1x_Enable(InstancePtr->Hdcp14Ptr);
        XHdcp1x_Poll(InstancePtr->Hdcp14Ptr);
      }
      else {
        Status1 = XST_FAILURE;
      }
#else
      Status1 = XST_FAILURE;
#endif
#ifdef XPAR_XHDCP22_TX_NUM_INSTANCES
      if (InstancePtr->Hdcp22Ptr) {
        Status2 = XHdcp22Tx_Disable(InstancePtr->Hdcp22Ptr);
      }
#endif
      break;
    case XV_HDMITXSS1_HDCP_22 :
#ifdef XPAR_XHDCP_NUM_INSTANCES
      if (InstancePtr->Hdcp14Ptr) {
        Status1 = XHdcp1x_Disable(InstancePtr->Hdcp14Ptr);
        XHdcp1x_Poll(InstancePtr->Hdcp14Ptr);
      }
#endif
#ifdef XPAR_XHDCP22_TX_NUM_INSTANCES
      if (InstancePtr->Hdcp22Ptr) {
        Status2 = XHdcp22Tx_Enable(InstancePtr->Hdcp22Ptr);
      }
      else {
        Status2 = XST_FAILURE;
      }
#else
      Status2 = XST_FAILURE;
#endif
      break;
    default :
      return XST_FAILURE;
  }
  return (Status1 == XST_SUCCESS &&
          Status2 == XST_SUCCESS) ?
          XST_SUCCESS : XST_FAILURE;
}
int XV_HdmiTxSs1_HdcpEnable ( XV_HdmiTxSs1 * InstancePtr ) { Xil_AssertNonvoid ( InstancePtr != NULL ) ; int Status1 = XST_SUCCESS ; int Status2 = XST_SUCCESS ; switch ( InstancePtr -> HdcpProtocol ) { case XV_HDMITXSS1_HDCP_NONE : #ifdef XPAR_XHDCP_NUM_INSTANCES if ( InstancePtr -> Hdcp14Ptr ) { Status1 = XHdcp1x_Disable ( InstancePtr -> Hdcp14Ptr ) ; XHdcp1x_Poll ( InstancePtr -> Hdcp14Ptr ) ; } #endif #ifdef XPAR_XHDCP22_TX_NUM_INSTANCES if ( InstancePtr -> Hdcp22Ptr ) { Status2 = XHdcp22Tx_Disable ( InstancePtr -> Hdcp22Ptr ) ; } #endif break ; case XV_HDMITXSS1_HDCP_14 : #ifdef XPAR_XHDCP_NUM_INSTANCES if ( InstancePtr -> Hdcp14Ptr ) { Status1 = XHdcp1x_Enable ( InstancePtr -> Hdcp14Ptr ) ; XHdcp1x_Poll ( InstancePtr -> Hdcp14Ptr ) ; } else { Status1 = XST_FAILURE ; } #else Status1 = XST_FAILURE ; #endif #ifdef XPAR_XHDCP22_TX_NUM_INSTANCES if ( InstancePtr -> Hdcp22Ptr ) { Status2 = XHdcp22Tx_Disable ( InstancePtr -> Hdcp22Ptr ) ; } #endif break ; case XV_HDMITXSS1_HDCP_22 : #ifdef XPAR_XHDCP_NUM_INSTANCES if ( InstancePtr -> Hdcp14Ptr ) { Status1 = XHdcp1x_Disable ( InstancePtr -> Hdcp14Ptr ) ; XHdcp1x_Poll ( InstancePtr -> Hdcp14Ptr ) ; } #endif #ifdef XPAR_XHDCP22_TX_NUM_INSTANCES if ( InstancePtr -> Hdcp22Ptr ) { Status2 = XHdcp22Tx_Enable ( InstancePtr -> Hdcp22Ptr ) ; } else { Status2 = XST_FAILURE ; } #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.*/ /* Enable HDCP 2.2 and disable HDCP 1.4 */ /* This is needed to ensure that the previous command is executed.*/